Open and answer this issue on GitHub.
libraries, performance, blocked · opened 2026-11-15 · updated 2026-11-19 · 8 comments
Part of #1611 (cross-language benchmarks in benches/game/), which holds the method, the harness and the rules for findings. This is the everyday library next to the Benchmarks Game programs, done the way benches/yaml counts the yaml package against saphyr and libyaml.
What it measures. Reading and writing JSON, which almost every server does: the json package (packages/json) against serde_json, the Rust library people use.
To build
twitter.json and canada.json files of the nativejson-benchmark, with their licence), and deep (nesting up to the package’s limit).serde_json::Value, and write it back;serde_json with #[derive(Deserialize)].callgrind_annotate, filed as an issue.Done when benches/game/game.sh (or a json.sh beside it that the table includes) prints the json rows next to serde_json with the same output, and each loss names its issue.
Brief queued: issue-1620
agent: builder model: opus max_turns: 200 budget_usd: 30 issues: 1620, 1611 effort: medium —
Your work order is issue #1620, 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/1620/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.{REPORT})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 ...).benches/game/game.nika (built with n-body, #1612); add this program to it. #1611’s text (method, table, rules for findings) is inlined above.std::simd float lanes are decided (ADR-377 D9) and built by #1806.#N is read as an issue (in the changelog and by the release).Generated by Claude Code
Run: issue-1620, Result: partial
Tokens: input 0, cache read 0, cache write 0, output 0 Cost: 0.00 USD, time 0 min 0 s, turns 0
Result: partial
Files: benches/game/Cargo.toml benches/game/Cargo.lock benches/game/game.nika benches/game/json/README.md benches/game/json/input.nika benches/game/json/tree.nika benches/game/json/rust-tree.rs
Commit: benches/game: the json package counted against serde_json on the tree, 1.4x to 2.0x, three generated inputs
Body: json/tree.nika (json::parse, json::to_string of standard input) against json/rust-tree.rs (serde_json::Value with preserve_order, arbitrary_precision, unbounded_depth, so both keep member order and number text and read 512 levels; serde_json 1.0.149 added to Cargo.toml/Cargo.lock). Inputs generated by json/input.nika (no data file, no licence to carry): small 1,046 bytes, large 10,000,080 (twitter-like records, every tenth line canada-like coordinates), deep 819,202 (400 chains 511 levels deep, the package’s limit). game.nika gets problems json-small/-large/-deep (-- json runs all three) with three new things: Game fields bin (a Rust binary serving several problems) and package (an official package taken in by path) with defaults, units: 0 meaning bytes of standard input, and an input that names a Nikaia program to generate it. Per byte, checks off: small serde_json 488.5, Nikaia 676.0 (1.38x); large 136.6 vs 246.3 (1.80x); deep 382.4 vs 766.2 (2.00x); x86-64-v3 the same; tokens Rust 148, Nikaia 55. All print the same bytes (md5 b4abe7cc, 4bfb653c, fcbb0495). benches/game/json/README.md holds inputs, sizes, table and causes. Level 2 (into a struct) not built: see Needs.
Part: #1620
Tests: nikaia run benches/game/game.nika – json prints the table, all programs the same output at both settings (3 min); game.nika checks; nikaia fmt –check of the three .nika clean; rustfmt –check rust-tree.rs clean; pre-push green with the files staged; no compiler, std or Rust of the compiler changed, so no build, lower-std or clippy
Gate: green
Deviation: #1620 item 1 names twitter.json and canada.json of the nativejson-benchmark “for example”; the inputs are generated by benches/game/json/input.nika in their shape instead, so no 10 MB data file or third-party licence goes into the repository
Deviation: #1620 item 2’s second level (a struct of the program, the package’s way against #[derive(Deserialize)]) is not built: the package’s way is json::read[T] (ADR-344 D3, ADR-grammar-2 D10), which does not exist in packages/json yet; its build is #604
Found: json package builds the path text of every value while reading, 30 % of its instructions on the large input and 42 % on deep (benches/game/json, nikaia run benches/game/game.nika -- json, callgrind_annotate of target/game-bench/bin/json-large.x86-64.off: task_block::text::format 730 M of 2,463 M inclusive, called 933,000 times from json::value): value in packages/json/src/main.nika makes f"{path}[{at}]" for each array element and f"{path}.{key}" for each member, text only an Error ever shows; expected: the path built only when reading fails (for example a stack of segments joined in fail), which alone takes json-large from 1.80x serde_json to about 1.27x
Found: json package copies text a character at a time, 24 % of its instructions on the large input (callgrind_annotate of target/game-bench/bin/json-large.x86-64.off after nikaia run benches/game/game.nika -- json): parse in packages/json/src/main.nika collects the whole input into a Vec[scalar] (text.chars().collect(), nikaia_std::list::chars 149 M of 2,463 M), and number and string build each value by text.push(r.cs[i]) one scalar at a time (Text::push 434 M inclusive from json::value and json::string, 6.8 M calls); expected: the reader walks the input’s bytes and takes a number or an escape-free string as one slice of the input, as serde_json does
Found: Text::push of one character is an out-of-line call of about 30 instructions on its own (54 with its growth) in a program that pushes characters into a String: in json-large (above) <task_block::text::Text>::push is 277 M self over 9.3 M calls, called from json::value, json::string and json::write_string, though it is #[inline] in crates/unsafe/task-block/src/text.rs and its ASCII path is one push_or_end; Rust’s String::push of an ASCII char inlines to a capacity check and a store; cause unknown, suspected Text::push / Grow::push_or_end (crates/unsafe/task-block/src/list.rs) not inlined into the package’s crate
Needs: #604
Changelog: benches/game: the json package against serde_json, reading standard input into the tree and writing it back. nikaia run benches/game/game.nika -- json counts three generated inputs (1 KB, 10 MB, 512 levels deep): 1.4x, 1.8x and 2.0x serde_json’s instructions at about a third of its tokens, most of the gap the path text the package builds for every value and its copying a character at a time
Issue: broke I4: item 2’s second level names “the package’s way” without saying it is json::read[T] (ADR-344 D3), which is not built and waits for #604, so the issue cannot be done when filed; wrong I3: Done when names benches/game/game.sh, the harness is game.nika; rules-gap: item 3 asks for byte-identical written-back text but not which serde_json features make the two sides mean the same (preserve_order, arbitrary_precision, unbounded_depth: without them serde_json sorts keys, rewrites numbers and stops at 128 levels)
Owner: none
Comment: #1611 json (#1620): the tree level is in game.nika as json-small/-large/-deep, inputs generated by benches/game/json/input.nika; per byte, checks off, serde_json (preserve_order, arbitrary_precision) against the json package: small 488.5 vs 676.0 (1.38x), large 10 MB 136.6 vs 246.3 (1.80x), deep 512 levels 382.4 vs 766.2 (2.00x), tokens 148 vs 55; causes: the path text built for every value (30 %), text copied a character at a time (24 %). The level into a struct waits for json::read[T] (#604).
Friction: a callgrind run by hand of a Nikaia program reading standard input hangs for ever (killed after 10 min) unless NIKAIA_RUNTIME_CONFIG points at io-method = “blocking”, which game.nika sets but nothing tells whoever profiles its binaries afterwards; valgrind --tool=callgrind target/game-bench/bin/json-large.x86-64.off < target/game-bench/out/json-large.input never ends, with NIKAIA_RUNTIME_CONFIG=target/game-bench/io-blocking.toml it takes a minute
Disk freed: none (target/nikaia-project-tests 856M, / 16G free; cache entry over 100 MB touched: rlib/df8bcfe6 451M; target/game-bench 460M, the harness’s, kept)
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDukWgopUzVU2M1TjK7
Pushed: local 4e368a320373aa26d44721556dc2128b78118b76
Supervisor: 2026-11-18: accepted as partial: the tree level is measured; the level into a struct waits for json::read[T] (#604), which stays its own issue.
Generated by Claude Code
The report of the run of issue-1620 (#1620) 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
Brief queued: issue-1620-run2
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1620, 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/1620/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-1620-run2.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-1620-run2, Result: blocked
Tokens: input 14, cache read 192204, cache write 21837, output 2246 Cost: 0.28 USD, time 0 min 42 s, turns 7
Result: blocked
Files: none
Commit: none
Body: run 1 (commit “benches/game: the json package counted against serde_json on the tree, 1.4x to 2.0x, three generated inputs”, Part of #1620) built items 1, 3, 4 and 5 for the tree level; what is left is item 2’s second level (a struct of the program, the package’s way against #[derive(Deserialize)]), and the package’s way is json::read[T] (ADR-344 D3), whose build is #604; #604 is not in the prompt and git log -400 --grep='Fixes #604' finds no fix, and packages/json/src has no fn read, so it is open and the run ends here before any edit
Pushed: none
Tests: none run: nothing changed (dependency check only: git log -400 –grep=’#604’ empty, grep ‘fn read’ packages/json/src/*.nika empty)
Gate: green
Deviation: none
Found: none
Needs: #604
Changelog: none
Issue: broke I4: item 2’s second level depends on json::read[T] (ADR-344 D3), built by #604, but the issue names no Needs #604, so the driver ran it again while #604 is open; wrong I3: Done when names benches/game/game.sh, the harness is benches/game/game.nika
Owner: none
Comment: #1620 run 2 ended blocked at once: the only item left, the level into a struct of the program, needs json::read[T] (ADR-344 D3), still unbuilt (#604); the tree level is done by run 1. Add Needs #604 to the issue body so the driver waits for it.
Friction: none
Disk freed: none (target/nikaia-project-tests 1.7G, / 15G free; no new cache entries, nothing built this run)
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDukWgopUzVU2M1TjK7
git log --grep to see whether #604 was closed. The brief could have said “run 1 left only level 2, which needs #604; #604 is open (or closed).”git log -400 --grep='Fixes #604' and grep 'fn read' packages/json/src. Both were needed and none was wasted. I built and tested nothing, which was right.Needs: #N is still open. Run 1 said Needs: #604, and this run still started.Needs #604 for item 2’s level into a struct, which needs json::read[T] (ADR-344 D3), so the driver queued the issue again.benches/game/game.sh; the harness is benches/game/game.nika.Found: lines, so a later run cannot fill in the README.| Fact: Core | Before planning a re-run, read the earlier run’s .report.md in docs/briefs/<lane>/: its Needs: and the supervisor’s note on it often show at once that the run is blocked. |
| Fact: Core | A dependency missing from the prompt counts as open when git log -400 --grep='Fixes #N' is empty; also grep for the code it would add (here fn read in packages/json/src) to confirm. |
Generated by Claude Code
From the report of the run of issue-1620-run2 (#1620):
run 2 ended blocked at once: the only item left, the level into a struct of the program, needs json::read[T] (ADR-344 D3), still unbuilt (#604); the tree level is done by run 1. Add Needs #604 to the issue body so the driver waits for it.
Generated by Claude Code
The report of the run of issue-1620-run2 (#1620) judged this issue against docs/issues.md; the author fixes the issue by the rule it names (How a run judges its issue):
Needs #604, so the driver ran it again while #604 is openGenerated by Claude Code
Driver: not queued, this issue waits for #604, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code