Open and answer this issue on GitHub.
performance, blocked, ci · opened 2026-11-07 · updated 2026-11-19 · 12 comments
The ledger phase of nikaia lower-std recomputes only what changed. After 645eaeac (#1277) it takes 11.0 s on every run, warm or cold (tether 2.4, check_units 3.6, result_sources+places_stored 3.1, keeps 0.9 s), which alone is most of the 15 s budget of a body edit (14.9 s today).
host.check_units by the unit’s text plus the package declarations it reads (recorded the same way as in the per-file key issue split from #1277, item 2)..nika, in or beside crates/nikaia-std/src/tools/ledger_items.nika (ledger_infer_package).result_sources / places_stored pass (views::ResultPackage) follows the same store.nikaia.contracts / std.contracts are byte-identical to a fresh-salt full run, and a counter (in NIKAIA_LOWER_TIMES output) shows only the woken functions recomputed. As a tools/*.nika run by nikaia run (tests/compiler cannot drive lower-std).target/lower-std-times.log.A cache of the whole package’s ledger (every edit misses it); reading the committed nikaia.contracts as input (it confirms itself).
Brief queued: issue-1308
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1308, inlined below with its comments. There is no
brief written around it: plan your own steps from its To build list, build
them in order, commit after each finished step, and end when its Done when
holds (or at the limits of builder.md, reporting what is left). The
facts in your prompt are Core of docs/builder-facts.md; more on a topic:
nikaia run scripts/syntax.nika -- KEYWORD, a probe: nikaia run scripts/probe.nika -- SNIPPET.
Measure the issue against docs/issues.md while you work: what it lacked,
what was wrong in it. That answer goes into the report’s Issue: field.
A finding, a changed plan or a finished item also goes into the issue as a
comment (gh api repos/Nikaia-Foundation/Nikaia/issues/1308/comments -F body=@file,
ending with the Claude Code footer), rule I13.
develop in the main checkout; other agents’ uncommitted files are not yours: never touch or stage them.target/fast/nikaia run scripts/commit.nika -- REPORT (it adds exactly the report’s Files:); the driver pushes.cargo build --profile fast -p nikaia, lower-std and its fixpoint when a tools/*.nika changed, cargo fmt, cargo clippy --all-targets -- -D warnings, nikaia run scripts/pre-push.nika, the tests the issue names and the ones your change touches.CHANGELOG.md, badges and NK codes are the supervisor’s. New tests in Nikaia only: a Rust test file an older issue names is built as a tests/compiler/tests/ program, no Deviation: and no Issue: point (I9, #1671).Body:. Found: is only for what lies outside the area, cannot be fixed this run or needs a decision; the driver files it as an issue.std or the toolchain lacks stops the work, unless an ADR or Part I-III refuses it (name it): Result: blocked, Found: the gap with a probe, Needs: supervisor decision.NIKAIA_CACHE_LIMIT=2G; at the end delete your own clone’s target/ and target/release/nikaia-scratch.Result: partial with what you ruled out, the probe, and the suspected file and function./home/user/Nikaia/docs/briefs/ci/issue-1308.md.report.md)Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), Comment (#N <text>, what to say on another issue; the driver posts it, one line each), Friction, Disk freed, and last Attribution: with your commit trailer lines below it.
Result:, Gate: (green or red <check>), Deviation:, Found: and the other fields with nothing to say hold the bare word: done, none. Anything after it reads as content.Result: done only when the issue’s Done when holds; partial with the items left otherwise.Deviation: only for an item of the issue built otherwise than written, or not built. Found: only for a defect outside your area, or one this run cannot fix: one defect per Found: line, with its probe and the output it gives, only the shapes that fail today, and the suspected file and function or cause unknown (#1695); a by-design behaviour is none (#1677). A correct program your own change refuses (a fail-closed check’s false refusal) is no Deviation: but one Found: line per shape, with its probe (#1680). Everything else goes into Body:; how you verified goes into Tests:.Issue: by docs/issues.md, How a run judges its issue: complete, or broke I<n>: ..., rules-gap: ..., wrong I<n>: ..., joined with ;; a point your own commit built gets (built) after its kind (rules-gap (built): ...), and the driver does not file it.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1308, Result: blocked
Tokens: input 36, cache read 837913, cache write 50053, output 8698 Cost: 0.78 USD, time 5 min 11 s, turns 18
Result: blocked
Pushed: none
Tests: none run (nothing built); baseline measured on a HEAD copy (git archive 7293a57a, binary target/fast/nikaia built at HEAD), a body edit in fmt.nika, NIKAIA_LOWER_TIMES=1 lower-std –sysroot COPY: wall 54.0 s, ledger 47.7 s (check_units 7.1, panics 28.6, tether 3.5, result_sources 2.8, places_stored 2.7, keeps 1.5, parse 3.0)
Gate: green
Deviation: none
Found: To build item 1 needs a per-unit key of “the unit’s text plus the package declarations it reads, recorded the same way as in the per-file key issue split from #1277 item 2”, and that recording does not exist at HEAD: sysroot_interface in crates/nikaia-std/src/compiler/sysroot_cache.nika still keys every file by the whole package’s bodiless text (bodiless[at] of every file) plus the whole inferred ledger own, with no list of the declarations a file reads; git log -400 --since=2026-11-06 finds no commit that built it, and the issue gives no number for it; no decision yet
Found: a per-function or per-unit ledger store that outlives one lower-std process needs on-disk forms nobody has decided: crate::check::Checked (findings, CheckFacts, methods, stored_code; crates/nikaia/src/check/mod.rs:77) has no text or byte form, and the passes the issue wants woken per function (sync, throws, touch, keeps, locks, panics, tether in crates/nikaia/src/contracts/.rs, 1743 lines, plus views::result_sources_in/places_stored_in) are Rust with whole-package infer(ledger, units, ...) entry points, so giving each one a per-function call is new Rust in Rust passes; CLAUDE.md “no new Rust” makes that a supervisor decision (move each pass into Nikaia first, or allow the Rust plumbing as #1277 did); no decision yet
Needs: supervisor decision: the issue for the per-file key of #1277 item 2 (recording the declarations a unit reads) filed or built first, and its number written into #1308 as Needs #N
Needs: supervisor decision: where and in what form the per-unit Checked and the per-function ledger facts are stored between runs, and whether the Rust passes (contracts/panics.rs, throws.rs, keeps.rs, tether.rs, sync.rs, touch.rs, locks.rs) get per-function entry points in Rust or move into .nika first
Changelog: none
Issue: wrong I4: the figures are stale: the ledger now takes 47.7 s on a body edit, not 11.0 s, and the panics pass (its second round proves units with the bounds walk, contracts/panics.rs infer) takes 28.6 s of that; *To build does not name panics at all, and it is the largest pass; broke I2: item 1 depends on the “per-file key issue split from #1277” without its number, so the driver cannot see it is still open; rules-gap: the issue orders per-function entry points for Rust passes and a cache of the Rust Checked without saying whether that Rust is allowed under “no new Rust”
Comment: #1308 Baseline at 7293a57a (body edit in fmt.nika, warm, NIKAIA_LOWER_TIMES): ledger 47.7 s of 54.0 s wall; panics 28.6, check_units 7.1, tether 3.5, result_sources 2.8, places_stored 2.7, keeps 1.5. Blocked: the per-file declaration key (#1277 item 2) is not built, and the per-function store needs a decision on its on-disk form and on Rust in contracts/*.rs.
Owner: none
Friction: none
Disk freed: 36M (scratch HEAD copy); target/nikaia-project-tests 1.8G, / 8.0G free of 252G; no cache entries over 100 MB created in this run
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDtmukJNapbMLmZMzTV
lower-std after a rebuild was cold (0 of 297 files from the cache, 2.5 min), and the second, unchanged, was the under-1 s path, which measures nothing. It took a third try, on a scratch HEAD copy with a body edit, to get a real figure.tools/ledger_items.nika now lives in compiler/). It never said whether the per-file key from #1277 item 2 exists (I checked sysroot_interface), or that the passes are Rust adapters in crates/nikaia/src/contracts/*.rs (1743 lines).lower-std, which was wasted, and one unchanged run that printed nothing, also wasted. The useful ones were the copy’s body-edit run plus a few greps and reads; no build and no tests.git archive a copy, warm it, edit one line, then NIKAIA_LOWER_TIMES=1 lower-std --sysroot COPY/crates. It should also warn that the first run after a build is cold.broke I2: it depends on the per-file key issue split from #1277 without giving its number.wrong I4: it says the ledger takes 11.0 s; it now takes 47.7 s, of which the panics bounds-walk proofs take 28.6 s, a pass the issue never names.rules-gap: no rule asks an issue that orders work in Rust code (per-function entry points, a saved form for Checked) to say whether the no-new-Rust rule allows it.wrong I4: the file paths still say tools/; the files are in compiler/.| Fact: Core | The first lower-std after a rebuild of target/fast/nikaia is cold (the binary is part of the cache key, 2-3 min), and an unchanged tree returns in under a second, so to time a body edit warm a scratch copy first, then edit one line in it. |
| Fact: Core | Since the bounds-walk changes, the ledger’s panics pass (its second round proves units, contracts/panics.rs infer) takes about 28 s of a body edit’s lower-std, the largest single pass. |
Generated by Claude Code
From the report of the run of issue-1308 (#1308):
Baseline at 7293a57a (body edit in fmt.nika, warm, NIKAIA_LOWER_TIMES): ledger 47.7 s of 54.0 s wall; panics 28.6, check_units 7.1, tether 3.5, result_sources 2.8, places_stored 2.7, keeps 1.5. Blocked: the per-file declaration key (#1277 item 2) is not built, and the per-function store needs a decision on its on-disk form and on Rust in contracts/*.rs.
Generated by Claude Code
The report of the run of issue-1308 (#1308) judged this issue against docs/issues.md; the author fixes the issue by the rule it names (How a run judges its issue):
Generated by Claude Code
Driver: not queued, this issue waits for #1912, #1913, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
From the report of the run of issue-1914 (#1914):
Needs #1912 (per-file declaration key of #1277 item 2). Needs #1913 (on-disk form of the per-unit Checked and per-function ledger facts, and whether contracts/*.rs get per-function entry points in Rust or move into .nika first). Baseline at 7293a57a: ledger 47.7 s of 54.0 s wall on a body edit, panics 28.6 s; To build should name panics.
Generated by Claude Code
The full table is on “lower-std: key each file on the interface entries it reads” (#1307). In short:
lower-std’s wall time on a body-only miss goes to the ledger phase (infer_package_parallel), which runs over the whole package on every miss.This issue’s open decisions:
Generated by Claude Code
The per-function entry is decided: ADR-100 D7 (owner, 2026-11-17, from #1984). Each contract pass gets an entry that returns one function’s final column from its callees’ stored columns, processed callees first, a recursive group (SCC) as one unit with the fixpoint inside it only; the whole-package entry stays and is the reference, compared on a package with a call chain and a recursive pair.
Generated by Claude Code
Brief queued: issue-1308
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1308, inlined below with its comments. There is no
brief written around it: plan your own steps from its To build list, build
them in order, commit after each finished step, and end when its Done when
holds (or at the limits of builder.md, reporting what is left). The
facts in your prompt are Core of docs/builder-facts.md; more on a topic:
nikaia run scripts/syntax.nika -- KEYWORD, a probe: nikaia run scripts/probe.nika -- SNIPPET.
Measure the issue against docs/issues.md while you work: what it lacked,
what was wrong in it. That answer goes into the report’s Issue: field.
A finding, a changed plan or a finished item also goes into the issue as a
comment (gh api repos/Nikaia-Foundation/Nikaia/issues/1308/comments -F body=@file,
ending with the Claude Code footer), rule I13.
develop in the main checkout; other agents’ uncommitted files are not yours: never touch or stage them.target/fast/nikaia run scripts/commit.nika -- REPORT (it adds exactly the report’s Files:); the driver pushes.cargo build --profile fast -p nikaia, lower-std and its fixpoint when a tools/*.nika changed, cargo fmt, cargo clippy --all-targets -- -D warnings, nikaia run scripts/pre-push.nika, the tests the issue names and the ones your change touches.CHANGELOG.md, badges and NK codes are the supervisor’s. New tests in Nikaia only: a Rust test file an older issue names is built as a tests/compiler/tests/ program, no Deviation: and no Issue: point (I9, #1671).Body:. Found: is only for what lies outside the area, cannot be fixed this run or needs a decision; the driver files it as an issue.std or the toolchain lacks stops the work, unless an ADR or Part I-III refuses it (name it): Result: blocked, Found: the gap with a probe, Needs: supervisor decision.NIKAIA_CACHE_LIMIT=2G; at the end delete your own clone’s target/ and target/release/nikaia-scratch.suspected, or does not mark (docs/issues.md I7), is a hypothesis: run the check that settles it (nikaia run scripts/where.nika -- NAME, the probe with a trace, callgrind for a cost) before you build on it (owner, 2026-11-16). Shown false: say so in Issue: as wrong I7: <what the check showed> (the driver comments it on the issue) and follow the real cause.Result: partial with what you ruled out, the probe, and the suspected file and function./home/user/Nikaia/docs/briefs/performance/issue-1308.md.report.md)Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), Comment (#N <text>, what to say on another issue; the driver posts it, one line each), Friction, Disk freed, and last Attribution: with your commit trailer lines below it.
Result:, Gate: (green or red <check>), Deviation:, Found: and the other fields with nothing to say hold the bare word: done, none. Anything after it reads as content.Result: done only when the issue’s Done when holds; partial with the items left otherwise.Deviation: only for an item of the issue built otherwise than written, or not built. Found: only for a defect outside your area, or one this run cannot fix: one defect per Found: line, with its probe and the output it gives, only the shapes that fail today, and the suspected file and function or cause unknown (#1695); a by-design behaviour is none (#1677). A correct program your own change refuses (a fail-closed check’s false refusal) is no Deviation: but one Found: line per shape, with its probe (#1680). Everything else goes into Body:; how you verified goes into Tests:.Issue: by docs/issues.md, How a run judges its issue: complete, or broke I<n>: ..., rules-gap: ..., wrong I<n>: ..., joined with ;; a point your own commit built gets (built) after its kind (rules-gap (built): ...), and the driver does not file it. complete is the bare word: prose after it (complete; the earlier runs ...) is filed as an improvement issue (#1931); history or a note for your own issue goes into Body: or Comment: #N <text>.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1308, Result: blocked
Tokens: input 12, cache read 156419, cache write 19186, output 2261 Cost: 0.26 USD, time 0 min 29 s, turns 6
Result: blocked
Files: none
Commit: none
Body: Stopped before any reading or editing: the issue depends on #1912 and #1913, and git log -400 --grep='Fixes #1912' and --grep='Fixes #1913' find no fix for either. ADR-100 D7 (7937d12a, from #1984) decides the per-function entry (callees first, an SCC as one unit, keyed by text plus callee columns). It does not decide the on-disk form of the stored columns, which #1913 asks. Cache target/nikaia-project-tests 1.8G; disk 7.5G free of 252G; no cache entries created in this run.
Fixes: none
Pushed: none
Tests: none (nothing built)
Gate: green
Deviation: none
Found: none
Needs: #1912 (per-unit key of the unit’s text plus the package declarations it reads, #1277 item 2), still open with no Fixes #1912 in the last 400 commits; item 1 of #1308 waits for it
Needs: #1913 (on-disk form of the per-unit Checked and per-function ledger store that outlives one lower-std process), still open with no Fixes #1913; ADR-100 D7 settles only the per-function entry, not where or how the columns are stored
Changelog: none
Issue: broke I2: To build item 1 still names “the per-file key issue split from #1277, item 2” without its number (#1912), and items 2-3 do not say they wait for #1913, so the issue says no Needs #N itself; the dependency is only in the comments; broke I11: the Goal quotes 11.0 s for the ledger without a commit or a split by pass that matches the 2026-11-16 baseline (47.7 s, panics 28.6 s), and To build still does not name the panics pass, the largest cost
Owner: none
Comment: #1913 ADR-100 D7 (from #1984) decided the per-function contract entry; what is still open for #1308 is the on-disk form of the stored per-function columns and the per-unit Checked (file layout, key, where it lives under target/); once that is written down, #1913 can close
Friction: none
Disk freed: none (cache 1.8G, 7.5G free)
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDukWgopUzVU2M1TjK7
git log --grep='Fixes #N' on each. I also read the ADR-100 D7 text to see how much of #1913 it answers.docs/issues.md: I took I11 from the subject of commit fa1101e9 and I2 from the earlier run’s comment, so those two judgements are unverified.broke I2: item 1 refers to “the per-file key issue split from #1277” instead of naming #1912.broke I2: the issue body has no Needs #1912 / Needs #1913 line; the dependencies appear only in comments.broke I11: the 11.0 s figure names no commit, and To build leaves out the panics pass (28.6 s, the largest cost).rules-gap: no rule asks that, when an ADR partly answers an issue’s dependency (D7 for #1913), the issue says what is still open.Fact: Core | ADR-100 D7 (owner, 2026-11-17) decides the per-function contract entry but not the on-disk form of the store, so #1308 still waits for #1913 until that form is decided.Generated by Claude Code
The report of the run of issue-1308 (#1308) judged this issue against docs/issues.md; the author fixes the issue by the rule it names (How a run judges its issue):
Needs #N itself; the dependency is only in the commentsGenerated by Claude Code
Driver: not queued, this issue waits for #1913, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code