Open and answer this issue on GitHub.
performance, blocked · opened 2026-11-15 · updated 2026-11-22 · 7 comments
Nikaia’s argument is that the compiler’s own analysis (ownership and handle duplication, sharing between tasks, pausing, what a function throws, outside data, bounds) holds up on a large program, not only on test programs. The best large program we have is our own: crates/nikaia-std/src/tools/*.nika holds 295 files and about 197,000 lines (wc -l, 2026-11-15). scripts/self_hosting.py counts 123,337 lines, which is 87.2 % of the toolchain. Two figures are missing, and readers ask for them:
docs/formal-verification.md §2: 2,677 indexes, 1,544 proved, and no file refused. That measures what the prover reaches, not how many of the warnings and refusals are wrong. We know such cases exist. The outside-data index check (NK1302) flags scripts/where.nika wrongly (#1624). Two programs in docs/solver-workload.md:211 did not compile and were written around.prove() at 1-6 % of nikaia lower on small examples, and 46 files in 0.65 s (docs/solver-workload.md). We have no curve for the whole tools package, and no split by analysis.Found while answering outside feedback, 2026-11-15: “Nikaia must show that its automatic analysis works reliably on large projects.”
This is measurement work, not language. Figures are counted with callgrind, never timed (docs/measuring.md). The checks measured are the ones of lower-std as it runs today: ADR-312 (handles), ADR-396 (outside data), ADR-385 (bounds), and the sharing, pause and throw analyses.
nikaia run scripts/analysis_scale.nika prints, for the tools package at the commit it runs on:
docs/analysis-at-scale.md records one run with its commit. Every false alarm found is filed as its own bug (or matches an existing one).
scripts/analysis_scale.nika. It runs nikaia lower-std --bounds (and the flags that print warnings) over the package and sums every NKxxxx warning by code and by file. The output is one table. Test: tests/compiler/tests/analysis_scale_*.nika on a small package of two files with known warnings, with its .stdout.docs/analysis-at-scale.md: up to 20 sites per code, chosen by a seed so they are the same on every run. Each site gets file:line and a verdict column. The builder fills in the verdicts by reading each site:
The rate is false alarms over reviewed sites, stated per code, with the sample size beside it.
lower-std can report instructions per phase. If it cannot, this item stops and says so: adding a phase report is its own issue. If it can, run callgrind on lower-std over growing parts of the package (files sorted by their dependencies, cut at 25 %, 50 %, 75 % and 100 %) and record instructions per analysis against lines. Say whether any analysis grows faster than linearly, and where.docs/analysis-at-scale.md with the tables, the commit and the commands. Link it from docs/formal-verification.md §2. Correct the stale size in docs/modular-compiler.md:21 (“213 files, 80 k lines”).Fixing the false alarms found (each is its own bug). The website figure: the page links this measurement once it exists.
Brief queued: issue-1625
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1625, 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/1625/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-1625.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-1625, Result: partial: item 3 (instructions per analysis) stops by the issue’s own rule, because lower-std reports wall time only (per phase, per ledger pass, per file check+emit) and runs the checker’s analyses inside one call; items 1, 2 and 4 are built
Tokens: input 278, cache read 9818133, cache write 187008, output 63726 Cost: 4.94 USD, time 4 min 4 s, turns 139
Result: partial: item 3 (instructions per analysis) stops by the issue’s own rule, because lower-std reports wall time only (per phase, per ledger pass, per file check+emit) and runs the checker’s analyses inside one call; items 1, 2 and 4 are built
Files: crates/nikaia-std/src/compiler/findings.nika crates/nikaia-std/src/compiler/lowered/findings.rs crates/nikaia-std/src/compiler/lowered.rs crates/nikaia/src/main.rs crates/nikaia/src/sysroot.rs docs/formal-verification.md docs/modular-compiler.md docs/analysis-at-scale.md scripts/analysis_scale.nika tests/compiler/tests/analysis_scale_sums_a_two_file_report.nika tests/compiler/tests/analysis_scale_sums_a_two_file_report.stdout
Commit: lower-std --findings and scripts/analysis_scale.nika: every warning the checker gives the compiler’s own package, by code, with a seeded reviewed sample (docs/analysis-at-scale.md)
Body: Commits: d7c89cf5 fixes an emitter defect that blocked the script (?? (rest, "") lent &rest, NK1343). 7a609c98 fixes two real defects that NK1111 found in the review (NK1111’s own headline showed {{{{, NK1227’s fallback showed extern {{ … }}). This commit adds findings_report (Nikaia), plus Rust plumbing for it: the clap flag --findings in main.rs and a third report switch in sysroot::bounds_tools (for #557/#125). Run: 271 files, 195,939 lines, 0 refused, 3,569 warnings (NK1261 2828, NK1350 722, NK1111 12, NK1216 6, NK1217 1). Sample: NK1261 0/20 false alarms, NK1350 0/20, NK1216 0/6, NK1217 0/1. NK1111 has 9/12, all migration notices that are by design (unmarked_hole), so none was filed. The “213 files, 80 k lines” in modular-compiler.md is now 271 files, 196 k lines.
Tests: analysis_scale_sums_a_two_file_report, plain_string_json_braces_are_no_doubled_brace (fails on the old binary: headline {{{{), a_split_fallback_of_a_literal_view_keys_a_map (fails on the old binary with NK1343): –both-settings ok; sysroot:: lib 8 ok; lower-std fixpoint clean; clippy, fmt, pre-push green
Gate: green
Deviation: item 3 not built: NIKAIA_LOWER_TIMES gives wall time per lower-std phase, per ledger pass (InferHost::timed) and per file check+emit, with no instruction counts and no split of the checker’s analyses (handles, outside data, bounds, lints), so docs/analysis-at-scale.md records the 2 min 0.7 s wall time of lower-std --findings instead
Found: a view pushed from a nested list of literals reaches rustc instead of NK1102: use std::process / fn main() throws { let runs: Vec[Vec[String]] = [["b"], ["c", "d"]]; for words in runs { let mut argv: Vec[String] = ["a"]; for w in words { argv.push(w) }; let out = process::run("echo", argv); print(out.stdout) } } gives today NK1343 “expected List<nikaia_std::block::Text> found List<EitherText<'_>>”; it should give NK1102 at the push, as the flat form let words: Vec[String] = ["b","c"]; for w in words { argv.push(w) } does; cause unknown, suspected in the checker’s view tracking of the elements of a nested list (check_takes.nika)
Found: a warning inside a match bound by a let points at the let, not at its expression: struct F { value: i64? } / fn main() { let fields: Vec[F] = [F { value: 3 }, F { value: null }]; for field in fields { let part = match field.value { null => 0, given => given ?? 0, }; println(part) } } gives NK1216 at 6:9 (let part = match ...) where the ?? is at line 8; let names = match false { true => "", false => "use a::{{B, C}};", } gives NK1111 at the let line too; the warning should point at the ?? or the string (it does for a ?? written directly in a let); suspected: the callers in check_fields.nika (NK1216) and check_host.nika unmarked_hole (NK1111) receive the enclosing statement’s span, not the expression’s; check: pass the expression’s span and run the probe
Needs: an instructions-per-analysis report in lower-std (callgrind-countable phases for each checker analysis: handles ADR-312, outside data ADR-396, bounds ADR-385, the lints), the issue’s item 3, which the issue says is its own issue
Changelog: nikaia lower-std --findings prints every warning the checker gives each file of the compiler’s own package, and scripts/analysis_scale.nika sums them by code against the lines checked with a seeded sample to review; the first run (docs/analysis-at-scale.md) found 18 warnings per 1000 lines and no false alarm outside NK1111’s migration notices
Issue: wrong I3 (built): it assumed lower-std could print the checker’s warnings, but it had no flag for them, so --findings was built; rules-gap: a “false alarm” category does not separate a by-design migration notice from a bug, so NK1111’s 9 by-design sites count as false alarms in the table and none was filed
Owner: none
Comment: none
Friction: builder-facts says to widen with i64::from(x), which gives NK1245; x as i64 works. One nikaia check of a single compiler file took over 5 minutes, so every per-site check went through probes. nikaia test takes no positional name; it takes --filter NAME.
Disk freed: none; target/nikaia-project-tests 1.9G, / 8.6G free of 252G, no new cache entry over 100 MB
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDukWgopUzVU2M1TjK7
Reviewed: 60329151c7d587aa8b9fcce3cd306814177b34724ca12c62387bae62a2f7939a
Pushed: local 69a3d4865c246ac3e56940c060603eeb4f990be4
lower-std had no way to print warnings, then building --findings (Nikaia report plus Rust plumbing) and running a full lower-std cycle. Next came the NK1343 split-fallback defect that blocked the script. Reviewing the sample was cheap once I read each site’s line with sed.sysroot::bounds_tools, CheckSeverity), and what NIKAIA_LOWER_TIMES measures (wall time only). Also the widening syntax (as i64), and that nikaia test filters with --filter, not a positional name.nikaia test --both-settings --filter, each fix test against the old binary, sysroot:: unit tests, clippy, fmt, pre-push.nikaia test NAME call (clap refusal), and one nikaia fmt --check pass that flagged whole-file indentation that was already there.nikaia check of a compiler file took over 5 minutes, which I couldn’t afford.--filter NAME) and say that nikaia fmt --check on compiler files shows existing tab/space differences, so judge fmt with pre-push on what is staged.lower-std prints the checker’s warnings; it drops them, and a flag had to be built.| knowledge: Core | NIKAIA_LOWER_TIMES=1 gives wall time per lower-std phase, per ledger pass and per file check+emit, with no instruction counts and no split by checker analysis. |
| Fact: Core | nikaia test --project tests/compiler takes --filter NAME (repeatable), not a positional test name. |
| Fact: Syntax gaps | widen with x as i64; i64::from(x) draws NK1245, whatever the facts file says. |
| Fact: Core | nikaia fmt --check on a compiler .nika names files whose existing indentation differs; trust scripts/pre-push.nika on what is staged. |
| Fact: Lowering | a warning inside a match bound by a let carries the let’s span, so its line can be several lines above the real site. |
Generated by Claude Code
Driver: not queued, this issue waits for #2187, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Driver: not queued, this issue waits for #2187, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Points moved here from the closed improve issue #2186: lower-std wants a per-analysis instruction report, and the notices need sorting into by-design versus false alarms (NK1111’s 9 sites).
Generated by Claude Code
From the report of the run of issue-2187 (#2187):
item 3 (#2187): nikaia run scripts/analysis_cost.nika prints instructions per checker analysis; scaling by dependency cuts is open, since 88 % of the package’s lines are one dependency cycle.
Generated by Claude Code
From the report of the run of issue-2649-run2 (#2649):
Item 3 (checker cost against lines) is measured in #2649: every analysis is linear in a file’s lines, but a fixed 676 M per file (views result_package, check_core_place_returned) is 61 % of the file checks and grows with the package
Generated by Claude Code