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-2811 (#2811) (owner, 2026-11-06).
benches/brc/fast.nika no longer builds at HEAD 78b2a90c (0.0.1556, target/perf/nikaia, a project of [package] name = "perf" with [build] user-parallelism = "no", optimization either “” or “remove-bounds-checks:on,remove-overflow-checks:on,skip-free-at-exit:on”, [build.x86_64-linux] opt-level = 3 codegen-units = 1, src/main.nika = benches/brc/fast.nika, nikaia build): error[NK1300]: assert(pos >= 0 && len >= 0 && pos + len <= buf.len()), the precondition of Table::slot_of, is not proved: 2 calls do not prove it (main.nika:82, calls on lines 143 and 184) and error[NK1300]: assert(stop > 0 && stop <= buf.len() - MARGIN ...), the precondition of Table::run, is not proved: 2 calls do not prove it (main.nika:115, calls on 174 and 178). It should build, as brc.sh builds it and benches/brc/README.md quotes its counts. examples/1brc.nika and benches/brc/naive.nika build with the same manifest. check --asserts says derived slot_of: 0 <= pos, pos <= buf.len(), proved at the calls on lines 143, 184, but not the len part. Cause unknown; the regression’s commit is not bisected (last edit of fast.nika: 2ed52c4b0, 2026-11-14).
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-2817
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2817, 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/2817/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-2817.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-2817, Result: partial
Tokens: input 246, cache read 7149839, cache write 190003, output 45898 Cost: 4.20 USD, time 5 min 2 s, turns 123
Result: partial
Files: crates/nikaia-std/src/compiler/prover_loops.nika crates/nikaia-std/src/compiler/prover_walk.nika crates/nikaia-std/src/compiler/lowered.rs crates/nikaia-std/src/compiler/lowered/prover_loops.rs crates/nikaia-std/src/compiler/lowered/prover_walk.rs crates/nikaia-std/src/compiler/lowered/logic/lowered.rs crates/nikaia-std/src/compiler/lowered/logic/lowered/sv_sat.rs tests/compiler/tests/a_counter_bounded_by_one_conjunct_of_the_guard_is_proved.nika tests/compiler/tests/a_counter_bounded_by_one_conjunct_of_the_guard_is_proved.stdout tests/compiler/tests/a_mask_first_taken_by_a_fallback_is_below_64.nika tests/compiler/tests/a_mask_first_taken_by_a_fallback_is_below_64.stdout benches/brc/fast.nika
Commit: prover: a loop’s counter is bounded by one conjunct of its guard; Mask::first’s ensures hold under ??
Body: prover_loops loop_record: a condition claim_term cannot read whole still gives its readable && parts (claim_parts) to the turn, its exit stays empty (new way_out param of loop_record_of, so the exit is never weakened); loop_candidates tries each conjunct of the guard for the counter-against-bound and interval rules (while cut > 0 && b[cut - 1] != 10 { cut -= 1 } now proves cut >= 0). prover_walk prover_found_facts: a std ensures without result == null || is said of the number the option holds (ADR-377 D7), so m.first() ?? -1 then if hit >= 0 proves hit < 64. Lowered: logic sv_sat.rs gains a proven write (falsified[at]). fast.nika’s merge passes s.name.len() so slot_of’s precondition holds. Both new tests failed with NK1300 on the unfixed binary. No bisect: history starts 2026-11-15.
Part: #2817
Tests: both new tests/compiler tests green –both-settings (each NK1300 on the unfixed binary); clippy –all-targets clean; lower-std fixpoint clean; fast.nika still 3 unproved calls (lines 143, 174, 178)
Gate: green
Deviation: none
Found: a loop inside an if branch loses its facts after the join: fn scan(b: ref Bytes) -> i64 { let n = b.len(); let mut cut = 0; if n > 5 { while cut < 3 { cut += 1 } }; assert(cut <= 3); return cut } with nikaia check --asserts gives “refused, not proved: nothing before it shows it”, should be proved as without the if (“proved through the loop that changes cut, with the invariant cut >= 0 && cut < 4”); suspected prover_scope.nika forget (line 253) drops the branch’s LoopRecord when the join forgets cut, and prover_join_arms carries no loop fact past the join (check: trace scope.loops at prover_join_arms); this blocks benches/brc/fast.nika scan (run calls at lines 174, 178)
Found: benches/brc/fast.nika line 143 self.slot_of(w0, w1, len, buf, pos) in run is not proved (NK1300 precondition pos + len <= buf.len()): needs the outer while true invariant pos < stop with stop <= buf.len() - MARGIN and len <= 100; cause unknown, not traced (probe: target/fast/nikaia check src/main.nika on a package holding benches/brc/fast.nika as main.nika)
Needs: #2817 again after the Found on loop facts past an if join is built
Changelog: Prover: a loop’s guard is read conjunct by conjunct — while cut > 0 && b[cut - 1] != 10 bounds cut though the byte test is unreadable — and Mask::first’s ensures hold of the number under ??.
Issue: fits docs/issues.md; the Found’s single cause was really three (Mask::first under ??, a guard’s conjuncts, loop facts past an if join)
Comment: #2817 two of three causes fixed (guard conjuncts, Mask::first under ??); left: loop facts inside an if branch are lost after the join (scan), and the outer-loop bound for slot_of in run
Friction: none
Disk freed: none, cache 2.0G, disk 12G free, no new entry over 100 MB
Reviewed: cdc8aef41f45d5894d24559c69201cfdb89ba5097600280ebf76a1d9abdab2ff
Pushed: local 0a3515230db066f0e3901ed49bd5faed19c84462
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDutPTwP5Xj5HkGuidk
fast.nika, and I found three causes in sequence: Mask::first under ??, a loop guard read part by part, and loop facts lost after an if. Reading prover_loops.nika and prover_walk.nika to learn how loop records and the turn and exit conditions work also took many turns.loop_record and loop_candidates), that a std ensures without result == null || is said of the number the option holds (ADR-377 D7), claim_term against claim_parts, and that nikaia run refuses a file in tests/compiler/tests, so nikaia test --filter is the way.v.sh with check --asserts; both new tests run with --both-settings; clippy; lower-std and its fixpoint; pre-push; the dry run of commit.nika. Wasted: one probe broken by \&\& escaping, one that put assert(...) inside assert(...), and a first try of each test without throws on main.check prints them all at once), split into one reduced probe per site. I would have seen three separate causes at the start instead of one by one.broke I5: the Found named only “no longer builds”, with no failing lines and no reduced probe per refused claim.rules-gap: no rule asks for the last commit at which the bench still built. Bisecting was impossible because the history starts on 2026-11-15.knowledge: Ledger and bounds proofs | a std ensures without result == null |
` is read of the option’s number only in the bounds walk, not in prover_found_facts, until 0a351523.` |
Fact: Ledger and bounds proofs | facts a loop inside an if branch proves are lost after the join (forget in prover_scope.nika drops the LoopRecord), so if c { while … }; assert(…) is refused.Fact: Core | x ?? text.clone() on a view of a String draws NK1185; write ?? text.Fact: Core | a tests/compiler program that prints needs fn main() throws (NK2605).Fact: Ledger and bounds proofs | loop invariants: prover_loops.nika loop_record, loop_record_of (turn condition against way_out exit), loop_candidates; probe with nikaia check –asserts FILE, which prints each assert's invariant.Fact: Ledger and bounds proofs | benches/brc/fast.nika at 0a351523 (2026-12-01): 3 unproved calls, lines 143 (slot_of in run), 174 and 178 (run in scan).Generated by Claude Code
From the report of the run of issue-2817 (#2817):
two of three causes fixed (guard conjuncts, Mask::first under ??); left: loop facts inside an if branch are lost after the join (scan), and the outer-loop bound for slot_of in run
Generated by Claude Code
Two of the three causes are fixed and on develop (26f7dc9c): a loop guard is now read conjunct by conjunct, and Mask::first’s ensures hold under ??.
Still open:
if branch loses its facts after the join. This blocks scan (the run calls at lines 174 and 178) and is filed as #3021.slot_of precondition in run (line 143) needs the outer loop bound pos < stop. Its cause has not been traced yet.This issue is labelled blocked until #3021 is built.
Generated by Claude Code