Open and answer this issue on GitHub.
blocked, bugs · opened 2026-11-23 · updated 2026-12-01 · 4 comments
Filed by the driver from the Found: of the run of issue-2804 (#2804) (owner, 2026-11-06).
build-time code is compiled as one program per comptime value, not one crate per package as ADR-321 D4 says (“The package’s build-time code is one crate, compiled by rustc directly and run once”): a cold env -u CARGO_TARGET_DIR NIKAIA_CACHE_DIR=<fresh> nikaia build --locked of a git archive HEAD tests/build-time copy (crates symlinked; 60d45569c, $NIKAIA_OLD) takes 116 s and leaves 37 directories under target/nikaia/build-time/comptime/, each with its own main.rs, run binary and answer, written about 1-3 s apart; expected: one crate under that directory per build, compiled and run once; traced: comptime_bundle_run (crates/nikaia-std/src/compiler/comptime_bundle.nika) compiles and runs one program per value, called once per value through comptime_computed (comptime_tree.nika); batching the values while keeping per-comptime bounds (D11), earlier values feeding later ones and the per-value cache (#2149) is a redesign that does not fit this run
develop first: the run that wrote it may have used a binary older than the tip, so it may be fixed already (#1822: #1788 was filed from a probe a fix under #1754 had already made pass). A probe that passes there names the commit that fixed it (git log -400 --grep by topic, since a fix often lands under another issue’s number), and the run builds only a tests/compiler/tests/ test that pins it (docs/issues.md I13).std defect with a probe (nikaia run scripts/probe.nika -- SNIPPET; a lowered file that differs, with an uncached lower-std of a git archive HEAD copy, NIKAIA_LOWER_CACHE_SALT fresh and --sysroot COPY/crates, its lowered/ diffed against the copy’s, never the shared working tree’s, #1793), a defect in docs/, guide/, website/ or scripts/ (a stale example, a wrong rule) with the command or check that shows it; a behaviour the code does on purpose (name the function or ADR) closes it as by design. The Found line may lack them (#1710): the commit message, or the report’s Body: when closed, gives the probe or check with its expected output, the ADR or Part I-III section that says so, and its actual output (docs/issues.md I5, I6), and the cause, file and function, traced or suspected (I7).std defect in the compiler, a stale page example or rule in its page or docs/ file, a script defect in the script. Add a test in tests/compiler/tests/ unless a check that already runs turns red on it (name it: pre-push’s page-examples for guide/ and website/, check-adr-refs.nika for a docs citation).The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.
Generated by Claude Code
Brief queued: issue-2827
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2827, 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/2827/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/bugs/issue-2827.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-2827, Result: blocked
Tokens: input 30, cache read 638837, cache write 42625, output 8088 Cost: 0.68 USD, time 1 min 48 s, turns 15
Result: blocked
Body: reproduced on HEAD 69e21888d (target/fast/nikaia, built after it): a scratch package [package] name = "ct2827" with fn sum_to(n: i64) -> i64 { let mut s = 0; for i in 0..n { s = s + i + 1764587000 }; return s }, comptime A: i64 = sum_to(10), comptime B: i64 = sum_to(20), comptime C: i64 = sum_to(30) and a fn main() throws printing them, nikaia run, leaves 3 directories under target/nikaia/build-time/comptime/, each with its own main.rs, run and answer (11:21:51-11:21:52); ADR-321 D4 expects one crate per package, compiled and run once. Traced: the checker asks for each value on its own (crates/nikaia/src/comptime_run.rs compute -> comptime_tree.nika comptime_value_computed -> comptime_computed, which builds sub_program for that value with earlier values inlined through known, then comptime_driven/cr_with_driver and host.run_comptime); comptime_bundle.nika changed since the Found only in dfb27ed41 (library naming), so the Found holds on develop
Pushed: none
Tests: probe above on target/fast/nikaia (HEAD 69e21888d): 3 values, 3 crates; nothing built, no test run
Gate: green
Deviation: none
Found: none
Needs: supervisor decision: ADR-321 D4 as one crate per package is a redesign across several passes that the issue gives no To build items for. Open choices: (1) the checker computes values on demand, so a batch must collect the package’s comptimes (written types, D2 rule per value) before or at the first request; (2) a value that cannot be lowered or crossed, or is forbidden, is either left out of the batch and run alone, or refuses the batch; (3) a stop (NK1152/NK1244) ends the shared run, or each value runs under its own counters reset (D11) and recovery; (4) earlier values feeding later ones (comptime_worked_out_ahead, Part II 10.2) get an order inside the crate instead of being inlined literals; (5) the per-value answer cache (#2149) stays the key, and only the misses are batched; (6) a dependency-home value (ADR-321 D13) gets a crate per home package. no decision yet
Changelog: none
Issue: broke I9: a redesign filed as a bug with the generic three items (reproduce, fix, test); it needs numbered items, one pass each (collect the batch, a multi-value driver in cr_with_driver, the host’s batched run and answers, the fallbacks), each settling choices (2)-(6) above; broke I8a: the cost (116 s for 37 values) has no measure of what a batch would save (rustc per crate against the shared dylib, D3)
Comment: #2827 Reproduced on 69e21888d: three comptime values in a scratch package give three crates under target/nikaia/build-time/comptime/ (main.rs, run, answer each). Cause traced: comptime_run.rs compute asks for one value at a time; comptime_tree.nika comptime_computed builds and runs one program per value. A batch needs decisions on what to do with values that are forbidden or can’t be lowered, how a stop works in a shared run, how earlier values are ordered, and the crate per home package. The run stopped before building; it needs numbered To build items.
Owner: none
Friction: none
Disk freed: scratch package target removed; target/nikaia-project-tests 2.0G, / 11G free; no new cache entries over 100 MB
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDutPTwP5Xj5HkGuidk
comptime_value_computed, comptime_computed and the Rust compute that calls them, to see that the checker asks for values one at a time. The reproduction itself took one call. The whole run was about 15 calls and about $0.60.comptime_run.rs the checker calls into the computation, and the text of ADR-321 D4, D5, D11 and D13. Neither the issue nor the facts gave these. The brief could have named comptime_run.rs compute as the entry point and quoted D4 and D11.where.nika on two names, the file outline, and a three-value scratch package with its directory timestamps. None was wasted. I chose not to rerun the Found’s 116 s cold tests/build-time probe, because the small package showed the same thing in 1 s.ready from a Found: that says the fix is “a redesign that does not fit this run”. It should file it as decision, or as a request for a planning brief. The builder’s run then becomes only a reproduction.broke I9: it has only the generic reproduce/fix/test items for a redesign over several passes. There are no items, one per pass, that settle the batch’s choices (fallback for one bad value, how a stop works in a shared run, ordering, cache key, one crate per home package).broke I8a: it gives no estimate of what a batch saves (a rustc compile and link per crate against the shared library) compared with 116 s for 37 values.knowledge: Core | A comptime's directory under target/nikaia/build-time/comptime/ is written only on a miss in the per-value cache, so a reproduction needs function bodies changed from the last run (a constant made from date +%s works), not a fresh NIKAIA_CACHE_DIR.| Fact: Core | A Found: that says its own fix “does not fit this run” still arrives as a ready bug brief; check that sentence first and report blocked with the open choices, rather than starting the redesign. |
| Fact: Build-time runs | Values are computed one at a time: crates/nikaia/src/comptime_run.rs compute → comptime_tree.nika comptime_value_computed (per-value cache, #2149) → comptime_computed (sub_program, comptime_driven, cr_with_driver, host.run_comptime); comptime_bundle.nika builds the shared library (ADR-321 D3). |
| Fact: Build-time runs | 2026-12-01, HEAD 69e21888d: a three-comptime scratch package gave 3 crates (main.rs, run, answer each) in about 1 s in total; the measure is find target/nikaia/build-time/comptime -name main.rs | wc -l after nikaia run. |
| Fact: Build-time runs | The Found’s figure (116 s, 37 crates, cold tests/build-time, commit 60d45569c) is the cost a batch would cut. |
One slip of mine: the large constant in the report’s Body: snippet was typed in afterwards, not copied from the file that ran (the real file used $(date +%s)). The report says so.
Generated by Claude Code
From the report of the run of issue-2827 (#2827):
Reproduced on 69e21888d: three comptime values in a scratch package give three crates under target/nikaia/build-time/comptime/ (main.rs, run, answer each). Cause traced: comptime_run.rs compute asks for one value at a time; comptime_tree.nika comptime_computed builds and runs one program per value. A batch needs decisions on what to do with values that are forbidden or can’t be lowered, how a stop works in a shared run, how earlier values are ordered, and the crate per home package. The run stopped before building; it needs numbered To build items.
Generated by Claude Code
Driver: not queued, this issue waits for #3031, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code