-> i64?) hold for the value after the null test (sv_simplex form_var)Open and answer this issue on GitHub.
wip, solver · opened 2026-11-23 · updated 2026-11-23 · 2 comments
Split out of “bounds walk: a method’s found facts through self” (#1667) when its third run was accepted (2026-11-23).
form_var -> i64? in sv_simplex (sites 973/987 before sv_simplex moved to packages/logic) returns null or an index that is in range at every return. In the caller, after the value is matched or tested non-null, the bounds walk does not carry the callee’s range fact to it, so the read through it stays checked.
T? result, the same way as for a plain i64 result (ADR-306). It holds on the bound value in the non-null arm of match, after ?? continue / ?? return, and after if x != null.tests/compiler/tests/: fn at(xs: Vec[i64], v: i64) -> i64? returning null or a loop index, and a caller’s let i = at(xs, 3) ?? return; xs[i] is proved.The probe passes under both settings, and the mapped sites print proved, or the report names each site that still does not and why.
Brief queued: issue-2784
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #2784, 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/2784/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/solver/issue-2784.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-2784, Result: done
Tokens: input 46, cache read 855773, cache write 37363, output 10112 Cost: 0.71 USD, time 3 min 9 s, turns 23
Result: done
Files: tests/compiler/tests/a_methods_nullable_result_holds_its_found_facts_through_self.nika tests/compiler/tests/a_methods_nullable_result_holds_its_found_facts_through_self.stdout tests/compiler/tests/a_methods_nullable_result_holds_its_found_facts_through_self.bounds
Commit: bounds: a method’s nullable result holds its found facts through self, pinned (ADR-306 D23, D34)
Body: Items 1-2 were already built by “bounds: found facts through a nullable result, read through the unwrap (ADR-306 D23)” (#1758), whose test found_facts_through_a_nullable_result is the issue’s probe (free function; ?? return, match, != null, ?? 0 all proved). This commit pins the method form (self as an extra argument, D34 with D23): find/grow -> i64? through ?? return, match, != null, and handed on to a parameter, all proved. Item 3 mapped: form_var’s result reaches sv_simplex only at line 835 (passed to tighten at 843, 858) and 1598 (stored in SvLitView.var); tighten’s reads at 866-899 (self.upper/lower/touched/bound_at/row_of/big_values/values[v]) stay checked under ADR-391 D1, because form_var has no found fact to hand on: two of its returns are map values (known ?? 0 from self.col_var.get in column_var and from self.slack_of.get), of which the walk knows no fact (#797, #798), and tighten indexes lists other than var_col that new_var keeps as long as it by invariant only. The null test is not the cause.
Fixes: #2784
Tests: new test passes under target/fast/nikaia test –both-settings –filter a_methods_nullable_result; it passes on the unfixed compiler too (it pins existing behaviour, no compiler change); pre-push green
Gate: green
Deviation: none
Found: sv_simplex form_var (packages/logic/src/sv_simplex.nika:630) results stay unbounded: a method returning a map value that is always a position in a list field (let known: i64? = self.of.get(k); if known != null { return known ?? 0 } next to self.xs.push(k); let v = self.xs.len() - 1; self.of.insert(k, v); return v) leaves the caller’s let i = self.var(3) ?? return 0; self.xs[i] checked: “no fact bounds what it reads” (nikaia check –bounds, single file, HEAD build); a rule that a map’s values stay below a list field’s length (a type invariant over a map) is not specified, no decision yet; cause traced: bounds_walk knows no fact of a map element (#797, #798)
Needs: none
Changelog: none
Issue: wrong I7: the issue says the walk does not carry a nullable result’s fact to the unwrapped value; that already works (#1758, found_facts_through_a_nullable_result) for free functions and methods; the sv_simplex sites stay checked because form_var returns map values, which have no fact
Owner: none
Comment: none
Friction: none
Disk freed: none
Reviewed: a07cefa3dec10a2f3ca42d7e1d24ba491d6d21069002f32ebfd2083bafd8ad0e
Pushed: local 1823bdbba1e25a637538baca7f2b3d811efacfb4
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwk9ubq9teP7QCErff
HashMap probe failed three times: use collections::HashMap drew NK1337, use collections in a single file drew NK1339, and a bare HashMap drew NK1135. It took one more try to see that the --bounds table prints anyway. A .bounds file is blessed only if it already exists, which cost another turn.found_facts_through_a_nullable_result and its commit (#1758, ADR-306 D23), which had already built items 1–2. I also had to find how a .bounds expectation file gets created, and how to run --bounds on one package file (cd packages/logic && nikaia check --bounds src/F.nika; it prints every file of the package).--bounds run of sv_simplex, the new test under both settings, and pre-push. None was wasted, apart from the three failed HashMap probe tries.wrong I7: it puts the cause in carrying a fact across the null test. Facts already carry across it; the real cause is form_var returning map values.broke I5: its sites are line numbers from before sv_simplex moved, given without a probe of the real shape.rules-gap: no rule asks the filer to search tests/compiler/tests for an existing test of the shape before filing a split-out issue.Fact: Probes | A test's .bounds expectation is blessed only when the file already exists: touch NAME.bounds, then nikaia test --filter NAME --bless.Fact: Probes | A single-file probe cannot use collections (NK1339); a bare HashMap draws NK1135, but check --bounds still prints its table before the error.Fact: Ledger and bounds proofs | Facts on the value inside a T? result already carry through ?? return, match, != null and ??, for free functions and methods (tests found_facts_through_a_nullable_result and a_methods_nullable_result_holds_its_found_facts_through_self, 2026-11-23, 1823bdbb).Fact: Ledger and bounds proofs | cd packages/logic && nikaia check --bounds src/sv_simplex.nika: 417 indexes, 149 proved; 143 operations, 67 proved (2026-11-23, a4fc8f059).Fact: Ledger and bounds proofs | A method result that comes from a map value (col_var.get, slack_of.get) has no fact, so the sv_simplex tighten reads at 866-899 stay ADR-391 D1 (2026-11-23, a4fc8f059).Generated by Claude Code