Open and answer this issue on GitHub.
blocked, yaml · opened 2026-11-10 · updated 2026-11-21 · 21 comments
Filed by the driver from the Found: of the run of issue-1517 (#1517); rewritten by the supervisor (2026-11-10, updated 2026-11-19; goal raised 2026-11-20 by the owner: faster than saphyr-parser, the six causes below worked off).
Part of #928. Needs #2409 Needs #2410 Needs #2411 Needs #2417 Needs #2418 Needs #2419 Needs #2282
benches/yaml (#1517) counts yaml::events with checks off at 2.82x the instructions of saphyr-parser on the 10 MB input, 5.41x on deep, 2.78x on scalars and 3.37x on the suite cases. The callgrind profile names five causes (repro: nikaia run benches/yaml/bench.nika -- 1, then callgrind_annotate on target/yaml-bench/bin/events.off inputs/large.yaml):
walk/events in packages/yaml/src) returns a Vec[Event] per node and the parent extends it. Grow and extend take 42 % of yaml::events on deep.ds: Vec[Dir] through every node rule and clones it per call. List<Dir>::clone_in takes 5 % of large, where the list is empty.Props tries Tag(ds) in two alternatives on every node. parse_Tag and parse_Props take 10 % of large.large. There is a String per scalar, and the events are built from the Node tree rather than streamed.parse_PlainChar, list::chars): 9 % of large.After the second run (comment of 2026-11-10): large 2.20x, deep 2.53x, scalars 2.73x, suite 3.04x.
Each cause is its own commit, measured with callgrind before and after (docs/measuring.md):
Vec[Event] (a3d45c18).Props parses a tag once (ff882752).yaml::Yaml::events(bytes; limits:) (built in #1443, released 0.0.1460); re-measure. Remaining allocation: text() without the from_utf8 check on slices already known valid. The round-trip edit model is not part of this issue.tests/compiler/, per CLAUDE.md; one that needs a language decision is reported as Found.benches/yaml/bench.nika and update the table and the causes in benches/yaml/README.md.Each is its own issue, measured with callgrind before and after:
bytes(p) binding names like text(p) (#2409).@stream entry costs about what the in-memory parse costs (#2282).yaml::events with checks off counts fewer instructions than saphyr-parser on large, deep and scalars (benches/yaml/bench.nika), and the six issues above are closed.benches/yaml/README.md by a named, profiled cause, and that cause is filed as its own issue.Generated by Claude Code
Brief queued: issue-1548
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1548, 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/1548/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.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./home/user/Nikaia/docs/briefs/yaml/issue-1548.md.report.md)Fields: Result, Files, Commit, Body (optional), Fixes, Pushed, Tests, Gate, Deviation, Found, Needs, Changelog, Issue, Owner (a question for the owner), 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. 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 ;.done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).Generated by Claude Code
Run: issue-1548, ESCALATE claude exited with code 1
Tokens: input 412, cache read 13939627, cache write 302585, output 86062 Cost: 14.55 USD, time 2 min 2 s, turns 209
(none)
out list hit NK2302 in views.nika, then rustc E0621, which the compiler only showed as NK1127 through the default_limits() helper program.text_tiers.nika (walk_grammar).view_stored_in_a_branch_refused (#1085), and I only saw it on the rerun.emit_how writes lifetimes.ds is copied on every call (cause 2 is a lowering defect).check_core_places.nika → text_tiers.nika).m.sh, the compiler tests filtered on view, lent and place (they caught the #1085 regression), the yaml package tests (they caught the shifted line numbers in bounds.stdout), clippy and pre-push.rules-gapbroke I7Fact: Core | NK1127 "can't be computed while the program is built" on a compile-time default often hides a rustc error in the package itself; replace the default with a literal in a copy to see it.Fact: grammar | A rule's value is cloned at every call (winnow-grammar codegen rule.rs:50), and text_tiers did not bind rule values until #1548, so a field read off a struct rule value was refused with NK1106.Fact: Core | packages/yaml/tests/bounds.stdout holds source line numbers; any edit to main.nika needs a bless and a check that only the numbers moved.Two fixes are committed locally: views/emit (b283d1a0, deep 5.66 → 2.70 together with the walk) and the yaml walk (a3d45c18, large 2.84 → 2.52). Nothing is pushed. The text_tiers fix for rule values was in its build cycle when the run ended. It is not verified, not committed, and its new test has not been run on the old compiler. The Props change (cause 3) sits uncommitted in the yaml source. Causes 2, 4 and 5 and the README update are still open. No final report was written.
Generated by Claude Code
Run: issue-1548, Result: partial (left: cause 2 rule values cloned per call, cause 4 events from the parse with #1518, cause 5 run scan of plain scalars, the 1.5x target)
Tokens: input 166, cache read 5973314, cache write 128639, output 31846 Cost: 6.01 USD, time 31 min 18 s, turns 83
Result: partial (left: cause 2 rule values cloned per call, cause 4 events from the parse with #1518, cause 5 run scan of plain scalars, the 1.5x target)
Files: b283d1a0 views emit; a3d45c18 packages/yaml walk; ea344e1c text_tiers.nika + lowered + tests/compiler a_field_read_off_a_rule_value_keeps_the_tier_of_the_field; ff882752 packages/yaml Props; 4b8f758f benches/yaml/README.md
Commit: 4b8f758f benches/yaml: the table and the causes after the walk and properties fixes (5 commits, all local)
Body: issue comment: events/saphyr-parser now large 2.20 (was ~2.8), deep 2.53 (was 5.4), scalars 2.73, suite 3.04; load large 1.76; from_str 1.50; outputs byte-identical. Fixed: per-level event copying (walk pushes onto one list), Props read twice (read once, KeyTail/PropTail/FlowPropTail share it); text tiers bind a rule’s struct value like a fn param (found on the way, own test). Open: 2 needs a decision (below), 4 needs #1518, 5 blocked by a winnow-grammar defect (below).
Part: #1548
Pushed: local 4b8f758f
Tests: tests/compiler –filter grammar 69/69 both settings; new test fails on old binary (NK1106), passes now; yaml package 33/33 incl yaml_test_suite (bounds.stdout reblessed, line numbers only); lower-std fixpoint clean; clippy nikaia-std clean; cargo fmt; pre-push green
Gate: green
Deviation: causes 2, 4, 5 not built (decision, size, external macro defect); the 1.5x target not met
Found: (a) winnow-grammar 2eb219c: a label in a repeated group is out of scope for a guard in the same group: rule Run(flow: bool) = (x:any if(ok(x, flow)))+ -> { } gives NK1127 hiding rustc “cannot find value x” (probe scratchpad issue-1548/p2); (b) a rule value ref Vec[D] is refused at the call Two(ds) / Two([]) with NK1102 (probe p1), and rule values are passed by value and cloned per call (List
default_limits() hid the real rustc errors. Twice I had to copy the package and swap in a literal Limits before I could see the error behind it: the text-tier hole and the winnow-grammar guard scope. Rebuilding the README table by script was next; my first attempt mixed up the 3-pipe rows of different tables.check_grammar.nika grammar_value, emit_pattern.nika emit_pattern_call, and winnow-grammar codegen/rule.rs:50 (#name.clone()).--filter grammar; the yaml package with its yaml-test-suite; the lower-std fixpoint; clippy on nikaia-std; pre-push; one full bench at the end.rules-gap: it did not split package work from compiler or macro work. Cause 2 needs a language decision on rule values, and cause 5 needs a fix in the external winnow-grammar macro.broke I7: it gave no baseline per input at the current commit, only the README’s old figures, so I re-measured first.rules-gap: it did not say that cause 4 depends on #1518 and is too large for one run.| Fact: Core | NK1127 on a computed default (for example default_limits()) hides the rustc error behind it; replace the default with a literal in a copy of the package to see it. |
| Fact: lowering | Grammar rule values are passed by value and cloned per call (winnow-grammar rule.rs #name.clone()), and ref on a rule parameter is refused with NK1102. |
| Fact: lowering | In winnow-grammar 2eb219c, a label bound inside a repeated group ( x:any if(..x..) )+ is not in scope for the guard in that group. |
| Fact: Core | packages/yaml/tests/bounds.stdout holds line numbers of main.nika; bless it after any edit and check that only the numbers moved. |
Generated by Claude Code
Progress (second run). Events compared with saphyr-parser, counted by callgrind:
| input | before | now |
|---|---|---|
| large | 2.8x | 2.20x |
| deep | 5.4x | 2.53x |
| scalars | – | 2.73x |
| suite | – | 3.04x |
load on large is 1.76x and from_str is 1.50x. The fixes were:
What remains:
This issue stays open until those land and the figures are re-measured.
Generated by Claude Code
Blocked on #1318 (owner, 2026-11-10). No further optimization of the package until #1318 (warn on a .clone() that copies nothing new) is built. Then the first step here tests the compiler: can it already point to where the package must be optimized?
First step once #1318 is done
nikaia check on packages/yaml and list every needless-clone warning, with its file and line.#1560 is not part of this hold. The clone it removes is written by the grammar lowering and appears nowhere in the source, so #1318 could not warn about it.
Generated by Claude Code
Update on the step this issue waited for: the needless-clone warning (#1318) is built and closed.
nikaia fix removed were mostly in tests and helper scripts, plus one in the parser. The clone of the directives list came from the lowering and was removed by #1560. The needless-collect case is filed as #1981.Remaining path, in order of expected gain:
text() without a from_utf8 check on slices that are already known to be valid.The yaml lane is paused today for integration speed (#2154) and continues afterwards with these.
Generated by Claude Code
Unblocked, back to ready (supervisor, 2026-11-19). Everything this issue waited on has landed:
yaml::Yaml::events(bytes; limits:), events streamed from the parse) is released in 0.0.1460. That covers cause 4 for the event path. The edit model of #1518 is not needed for it.Next run, in order
benches/yaml, docs/measuring.md) at the current develop: large, deep, scalars and suite. Write the baseline table here before changing anything (I7).events(), if it does not use it already, and re-measure.text() without the from_utf8 check on slices that are already known valid. If this needs a compiler or lowering change, fix it in the compiler with its own test (ADR-grammar-1). If it needs a language decision, report it as Found.benches/yaml/README.md table and the causes.Done when events are at most 1.5x saphyr-parser on large, deep, scalars and suite, or the run shows, with the profile, which remaining gap needs a decision or a compiler change, filed as its own issue.
Generated by Claude Code
Driver: #1548 is not queued, its form misses what a builder needs (nikaia run scripts/issue-check.nika -- 1548, docs/issues.md, #2003):
Needs, Part of or Found while line names it (docs/issues.md I4)Label swapped from ready to decision: add what is missing (a Needs #M line for an issue it waits for, or Part of #M), then set ready again.
Generated by Claude Code
Brief queued: issue-1548-rerun
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1548, 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/1548/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/yaml/issue-1548-rerun.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-1548-rerun, Result: partial (items left: the two @stream Founds below and #1518; the text() from_utf8 check, 3%, not started)
Tokens: input 244, cache read 8223140, cache write 180711, output 51318 Cost: 4.33 USD, time 1 min 57 s, turns 122
Result: partial (items left: the two @stream Founds below and #1518; the text() from_utf8 check, 3%, not started)
Files: benches/yaml/README.md
Commit: yaml bench: the table at the plain-run change, the @stream causes
Body: fe829f75 makes the facade build again against the owned Event (#1443) and borrows a scalar from its span. c06fa0aa makes PlainMore take a run of plain characters as one guarded repetition (#1561); output is byte-identical; scalars 282.8M -> 278.3M; it also re-blesses bounds.stdout (stale since #1443) and facade.stdout. This commit re-measures the table and names the causes left. The streaming entry is not used in the bench: it costs 120x (Found).
Part: #1548
Tests: packages/yaml nikaia test: 35 of 35 after re-blessing bounds (stale line numbers since 8df05167e, red before) and facade (one label); events.off output byte-identical on deep and scalars (cmp); pre-push green
Gate: green
Deviation: item 4 (bench events case on yaml::Yaml::events) built and measured but not committed: 40,360M on deep against 340.8M, so the large row would take hours under callgrind
Found: yaml’s @stream entry makes every parse of the grammar slower: package packages/yaml at c06fa0aa, bench program benches/yaml/events/events.nika (yaml::documents(input) then for e in yaml::events(docs)), built with RUSTFLAGS='-C overflow-checks=off' nikaia build, over target/yaml-bench/inputs/deep.yaml counts 340.8M instructions; the same package with @stream entry rule events(...) and its rules Opened/FirstEvents/NextEvents/Ended/AtEnd removed counts 186.2M, output byte-identical; it should not depend on whether the grammar has a @stream entry, since documents does not stream; traced: winnow-grammar-macros codegen/edge.rs Codegen::edge wraps every parser in rt::edge_reach when the grammar has any stream rule (its ADR 27 §3), and emit_core_leaves.nika lowers one copy per input (emit_bytes_grammar), so the stream entry and stream share it; edge_reach is 26.4% self of deep; fix by a separate lowered copy for @stream entries or per-entry tracking in winnow-grammar, no decision yet
Found: for e in yaml::Yaml::events(input) { ... } (the events bench with the walk moved into fn lines(input: Bytes) -> String throws) prints the same events as yaml::events(yaml::documents(input)) but counts 40,360M instructions on target/yaml-bench/inputs/deep.yaml against 340.3M, and 5,464M against 278.3M on scalars.yaml; it should cost about what the in-memory parse costs (ADR-grammar-2 D7 streams so as not to hold the whole input); traced: winnow_grammar rt/stream.rs Stream::record_chunk (39.6G of 40.4G inclusive) parses the rule’s prefix again in the diagnosing pass, and the yaml rule’s prefix Opened Bom? Blanks DocEnd* FirstEvents(limits.depth) holds the whole first document (malloc/free 60%, ParseError::push_rule 11.7%); suspected that a grammar whose first document is a fold item as well avoids it (check: that rule shape, callgrind on deep)
Found: an alternation in a repeated group whose alternatives give different values fails rustc: fn ok(x: scalar, flow: bool) -> bool sync { return x != ':' && x != ' ' && !(flow && x == ',') } grammar G { rule WS = "" -> { } entry rule top -> String = s:text(Run(false)) -> { s } rule Safe(flow: bool) = x:any if(ok(x, flow)) -> { } rule Run(flow: bool) = (x:any if(ok(x, flow)) | ":" peek(Safe(flow)))+ -> { } } fn main() throws { println(G::top("ab:c") catch { return }) } with nikaia run main.nika gives NK1343 “expected … to return Result<char, ErrMode<__WgEr>>, but it returns Result<&str, ErrMode<_>>”; (any | ":")+ and (any | ":") fail the same; ("a" | "b:")+ and (x:any if(ok(x, flow)))+ work; it should print ab:c (a group’s alternatives are matched for their text only); suspected: winnow-grammar macro codegen of ModelPattern::Group alts (rev e1dd687), check: the macro’s expansion of Run
Needs: #1518 (allocation: the Node tree and a String per scalar before the events, 16% of large)
Changelog: yaml: plain scalars matched as a run of characters, not a rule call per character (#1548)
Issue: #1548 judged against docs/issues.md: the driver’s missing-Needs flag is moot (the supervisor’s 2026-11-19 comment drops #1518 as a dependency); wrong I7: the causes it lists are outdated, the main regression since 0.0.1424 (deep 177.8M -> 340.8M) is the @stream entry’s edge tracking (#1443), which the issue does not name
Comment: #1548 baseline at 42b3b8a21+fe829f75, millions of instructions, checks off, events vs saphyr-parser: large 7996.1 (2.63x), deep 340.8 (4.21x), scalars 282.8 (1.82x), suite 18.8 (3.56x); load vs saphyr: large 7752.2 (1.91x), deep 339.5 (2.84x), scalars 282.4 (1.92x), suite 17.6 (2.97x); from_str large 7384.8 (1.80x serde_yaml); after c06fa0aa: events large 7873.6 (2.59x), deep 340.3 (4.20x), scalars 278.3 (1.79x), suite 18.5 (3.52x); load large 7629.8 (1.88x); from_str 7262.3 (1.77x); large events.off profile: edge_reach 9% self, malloc/free 16%, from_utf8 of text() 3%
Friction: the bench’s facade did not build since the owned Event of #1443 (de.rs E0107/E0581/E0308), and packages/yaml/tests/bounds.stdout was stale since the same commit: a bench or package test that a change does not run goes red unseen
Disk freed: none; target/nikaia-project-tests 997M (new: yaml-facade/debug 997 MB), / 7.4G free; target/yaml-bench 739M
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDveRM5qKZKyCqq6Y24
Reviewed: 086f1feb68cf9082c1b0c9fe0e99961623dc5b6d2498c383276dd5b69a1e112b
Pushed: local af298bc0dd1bb671434853c856f717413afa0728
bench.nika run is about 30 min, and the first one failed on the facade build (the owned Event from #1443). After that, finding the real regression took several callgrind rounds plus a package copy with the @stream entry cut out to prove it. Waiting in one call was clumsy: a foreground until loop hit the 600 s cap.emit_core_leaves.nika, emit_bytes_grammar), winnow-grammar’s codegen/edge.rs and rt/stream.rs (record_chunk, Reading), the exp build command (RUSTFLAGS='-C overflow-checks=off' nikaia build), and how Yaml::events reports errors (events_stream.nika).nikaia test (3×), pre-push (2×), the commit dry runs. Wasted: one package test run in the scratch copy (bounds and facade fail there only because scripts/slot.nika and repo paths are missing), and a second nikaia test just to read the diffs, when > file the first time would have done.scripts/bench-one.nika PKG INPUT, that builds the events program against a given package and prints callgrind totals plus a cmp against the reference output. Its absence cost the most turns: I rebuilt measure.sh by hand, and without it every before/after needs a 30-min full bench.wrong I7: its causes predate #1443. The main regression is the @stream edge tracking (deep 177.8M → 340.8M), which it does not name.broke I5: no current figures; item 0 had to make them. That costs one bench run, and the bench was red (the facade didn’t build).rules-gap: no rule asks a feature commit like #1443’s to re-run the benches of the package it touches, and the bench went red unseen.knowledge: Lowering | a grammar with any @stream rule wraps every parser of that grammar in rt::edge_reach, so a non-stream entry of the same grammar pays for the tracking too.Fact: Lowering | an alternation in a repeated group whose alternatives give different values ((x:any if(g(x)) |
”:”)+) fails rustc with NK1343; keep such an alternative as its own rule alternative. |
Fact: Core | running a package's nikaia test rewrites its nikaia.proofs, nikaia.derived and nikaia.lock; commit them with a source change, else restore them by name.Fact: Lowering | a @stream entry re-parses its rule's prefix in the diagnosing pass (record_chunk), so a prefix that holds a whole document costs 20-120x the in-memory parse.Generated by Claude Code
From the report of the run of issue-1548-rerun (#1548):
baseline at 42b3b8a21+fe829f75, millions of instructions, checks off, events vs saphyr-parser: large 7996.1 (2.63x), deep 340.8 (4.21x), scalars 282.8 (1.82x), suite 18.8 (3.56x); load vs saphyr: large 7752.2 (1.91x), deep 339.5 (2.84x), scalars 282.4 (1.92x), suite 17.6 (2.97x); from_str large 7384.8 (1.80x serde_yaml); after c06fa0aa: events large 7873.6 (2.59x), deep 340.3 (4.20x), scalars 278.3 (1.79x), suite 18.5 (3.52x); load large 7629.8 (1.88x); from_str 7262.3 (1.77x); large events.off profile: edge_reach 9% self, malloc/free 16%, from_utf8 of text() 3%
Generated by Claude Code
The report of the run of issue-1548-rerun (#1548) 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
Driver: not queued, this issue waits for #1518, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
Unblocked: the edge-tracking cost (#2281) is gone with winnow-grammar 0612989. Next: step 0, re-measure against saphyr-parser at current develop, then causes 4 and 5.
Generated by Claude Code
Brief queued: issue-1548
agent: builder model: opus max_turns: 200 budget_usd: 30 effort: medium —
Your work order is issue #1548, 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/1548/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/yaml/issue-1548.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-1548, Result: partial
Tokens: input 210, cache read 10222542, cache write 151202, output 55755 Cost: 4.43 USD, time 1 min 53 s, turns 105
Result: partial
Files: benches/yaml/README.md
Commit: yaml bench: the table after the edge-tracking fix and the Blanks scan, the causes left on deep
Body: Step 0 baseline at 46045b3a (events.off vs saphyr-parser, millions, checks off): large 5887.1 (1.94x), deep 185.7 (2.29x), scalars 220.2 (1.42x), suite 15.1 (2.84x); load large 1.33x, deep 1.53x, scalars 1.46x; from_str 1.28x serde_yaml. The edge-tracking fix (#2281) did most of it. b346065e: Blanks scans a line’s spaces once (it scanned them three times, Blank then LastBlank’s two alternatives), fold hands back raw text with nothing to fold: deep 185.7 -> 164.1, large 5887 -> 5754. 6a21c8f5: the bench’s events program appends to its output as events_saphyr.rs does, not a String per event via f-strings: large 5754 -> 4495, deep 164.1 -> 140.6. Now: events large 1.48x, deep 1.74x, scalars 1.35x, suite 2.53x; load 1.28/1.34/1.46x; from_str 1.25x. Outputs byte-identical at every step on small, deep, scalars, large; the bench checks every program against the first. Tried and dropped: parsing valid UTF-8 input as text (NK1187, here over text waits for #743); a FlowItem alternative without the key’s text (deep 129.0, 1.59x) parses FlowAny twice on a failure and goes exponential (limits_depth_and_size timed out), so not committed. README names the causes left.
Part: #1548
Tests: nikaia test in packages/yaml 35/35 at b346065e (yaml_test_suite pass list included; bounds.stdout re-blessed, line numbers only); bench.nika full run green (same output checks); no compiler change, so no fails-before run
Gate: green
Deviation: To-build item 4 not built: the streaming yaml::Yaml::events still counts 40,279M on deep against 140.6M through documents+events (Stream::attempt re-parses the prefix, 99 %), so the bench keeps documents and events
Deviation: To-build item 4’s text() without from_utf8 not built: the cut by text positions it needs (ADR-374 D3/D4/D8) is not built, see the Found line
Found: a grammar’s bytes(p) binds no name inside p, unlike text(p), so a rule cannot keep a node and check its bytes unchecked; probe grammar G { rule WS = "" -> { } entry rule top -> i64 = b:bytes(v:Num) -> { v } rule Num -> i64 = d:digit -> { 7 } } fn main() throws { let x = G::top(Bytes([49])) catch { 0 } println(f"{x}") } gives error[NK1117]: \v` isn’t declared anywhere.; the same with text(v:Num) prints 7; Part II 10's grammar table binds names only inside text(..) and a labelled span(..); yaml's FlowItem/Key take text only to check a key stays on one line, 8 % of benches/yaml deep (deep 1.74x -> 1.59x without it); suspected emitter __nikaia_covered path in crates/nikaia-std/src/compiler/emit_pattern.nika; no decision yet
Found: ADR-374 D3/D4 text cuts are not built: fn main() throws { let mut s = String() s.push_str(“ab\ncd”) let m = s.find(“\n”) ?? return println(s.before(m.start)) println(s.after(m.end)) } gives error[NK1171]: String has no method called after (and before; s.start(), s.end(), between, forward(bytes:) the same), it should print ab and cd (ADR-374 D3); packages/yaml fold and block cut slices with bs[a..<b].text() and pay from_utf8 (about 5 % of benches/yaml large with the grammar's captures), which a cut at positions skips (D8); cause: not built, std text methods
Found: packages/yaml counts each line's indentation twice: Blanks (in Eol Blanks) scans the spaces of the next content line and fails, then Block counts them again with m:count(“ “) (up to its three alternatives): parse_Blanks_inner self 9.2M of 140.6M on benches/yaml deep (6.6 %); handing the count from Blanks to Block touches every rule that reads Eol Blanks v:Block`; traced (callgrind self cost, packages/yaml/src/main.nika rules Blanks and Block)
Needs: none
Changelog: none
Issue: wrong I7: the causes list was outdated, the largest gap since 0.0.1424 was the @stream edge tracking (#2281, fixed) and the bench program’s String per event (a fifth of large), neither named; broke I4: #1518 is named as a wait in a comment while the body says its edit model is not part of the issue
Comment: #1548 Re-measured at 6a21c8f5 (events.off vs saphyr-parser, checks off): large 1.48x, deep 1.74x, scalars 1.35x, suite 2.53x; load 1.28x/1.34x/1.46x/2.27x; from_str 1.25x serde_yaml. Baseline at 46045b3a before this run: 1.94x/2.29x/1.42x/2.84x. Deep stays above 1.5x: flow-entry text checks (8 %), indentation counted twice (7 %), the engine’s alternatives (15 %); the streaming entry still costs 40,279M on deep. Table and causes in benches/yaml/README.md.
Owner: none
Friction: none
Disk freed: 11M of scratch builds; target/nikaia-project-tests 993M (new entry yaml-facade/debug 993M); / 15G free
Reviewed: a8ff0b9759cdae6422837f11b29b4c5e22ccb6fd1e748c3ed3eea77a61dd8233
Pushed: local 67e097b92a543ec8607a47dd2c007cac26667a5e
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVxJDwSpspVvrTQMgwWNUS
limits_depth_and_size, which cost one package-test run.here over text isn’t built (NK1187, #743).bytes(p) binds no names inside it.target/.../gen/yaml/yaml.rs), and that grammar::covered_bytes runs from_utf8.cmp.sh (identical output on four inputs plus counts on deep, scalars and large), the yaml package tests, pre-push, and two full benches. Wasted: the count after the failed bytes(..) build, which reran a stale binary, and the facade/limits rerun that hit the 600 s tool timeout.limits_depth_and_size before anything is counted.wrong I7: the causes predate #2281, and the issue doesn’t name the bench program’s String per event (a fifth of large).broke I4: #1518 is named as a wait in a comment while the body excludes it.knowledge: Measuring | the yaml events program must append to its output as events_saphyr.rs does, or f-strings dominate the row.knowledge: Core | ADR-374 cuts (start/before/after/between/forward) are not built yet, so text slices still pay from_utf8.Fact: Probes | A grammar's bytes(p) binds no names inside p (only text(..) and a labelled span(..) do), so bytes(v:Rule) leaves v undeclared (NK1117).Fact: Measuring | bench.nika counts tokens from the source at the end of its run, so editing a bench program while it runs puts the new token count into the old table.Fact: Core | A grammar over text that uses here is refused (NK1187) until #743; a Bytes grammar's text(..) captures each pay from_utf8.Generated by Claude Code
From the report of the run of issue-1548 (#1548):
Re-measured at 6a21c8f5 (events.off vs saphyr-parser, checks off): large 1.48x, deep 1.74x, scalars 1.35x, suite 2.53x; load 1.28x/1.34x/1.46x/2.27x; from_str 1.25x serde_yaml. Baseline at 46045b3a before this run: 1.94x/2.29x/1.42x/2.84x. Deep stays above 1.5x: flow-entry text checks (8 %), indentation counted twice (7 %), the engine’s alternatives (15 %); the streaming entry still costs 40,279M on deep. Table and causes in benches/yaml/README.md.
Generated by Claude Code
The report of the run of issue-1548 (#1548) 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
Driver: not queued, this issue waits for #2409, #2410, #2411, #2417, #2418, #2419, #2282, which is still open (#1819). Set ready again when it is closed.
Generated by Claude Code
From the report of the run of issue-2420 (#2420):
The @stream walk over a String/Bytes now runs winnow-grammar’s slice entry (#2420): deep.yaml 277.0M -> 217.7M against 121.4M in memory. The rest is the walk’s thread and its zero-capacity channel for each item
Generated by Claude Code
From the report of the run of issue-2425 (#2425):
D32 (#2425) step 1 is in for String sources: a yaml walk whose events take whole String parameters into a mut out list is lent now; one taking a field of a lent node (n.raw) waits for the D5 part-store defect filed from #2425’s run.
Generated by Claude Code