Skip to content

spec(t27f): SpecGraph holds 1024 nodes and 4096 edges, u16 indices (Closes #10230) - #10231

Merged
gHashTag merged 1 commit into
masterfrom
claude/t27f-graph-caps-all
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/t27f-graph-caps-all

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #10230

SpecGraph held 192 nodes and 254 edges, so about 2 percent of the corpus (the biggest specs) was refused. This raises the caps to 1024 nodes and 4096 edges and moves edge endpoints to u16. Every spec in specs/ now fits; anything past the caps is still refused with ERR_TOO_MANY_*, never truncated.

Measurement (Railway lab, nothing on the Mac)

All 2225 specs/**/*.t27 files, exporter then derive pass (#10198), on a scratch build with 2048/8192 caps, then re-run on the final 1024/4096 build: 2225 of 2225 validate.

p50 p90 p95 p98 p99 p999 max
nodes 20 65 93 191 444 720 775 (igla/coder/eval)
edges 18 118 211 371 531 1573 3194 (t27o/rust_convert)

Headroom over the maximum: 1.32x nodes, 1.28x edges. An invariant keeps it at 25 percent or more. The doc block in spec_graph.t27 records the method.

Changes

  • spec_graph.t27: MAX_NODES 1024, MAX_EDGES 4096, arrays and blank_graph widened, edge_from/edge_to and with_edge endpoints u16, NO_INDEX 65535 (NO_CODE stays u8 255), measured numbers and constants, headroom invariant; the at-capacity test is rebuilt as 64 fns x 64 tests (distinct pairs).
  • spec_graph_export.t27: u16 edge endpoints, name-span arrays widened, the two capacity tests now cut an at-cap and an over-cap source from ONE literal by slicing.
  • spec_graph_derive.t27: only what the wider index forces: as u8 to as u16 at with_edge, and the two capacity tests made cap-relative.
  • spec_graph_fold.t27 (landed in spec(t27f): readable big graphs -- wrapped columns, kind fold, expand kind, hit testing #10228 while this was in review): only what the wider index forces: as u8 to as u16 at with_edge (expand_graph and the wide fixture) and three stale comments about MAX_NODES. The issue Boundary now lists it.
  • .claude/skills/t27f/SKILL.md: limits, and the exporter row no longer says "not wired to a host" (it is).
  • spec_graph_view.t27 and spec_graph_outline.t27 are unchanged: the view reads indices as u32.

Lab verification

  • t27c test-report: spec_graph 14/14, spec_graph_export 20/20, spec_graph_derive 10/10, spec_graph_outline 8/8, spec_graph_view 9/9, spec_graph_fold 12/12; 0 failing and 0 vacuous in each.
  • t27b test --check under qemu-aarch64: every test PASS in all six specs; t27c check: Typecheck OK for all six. Re-run on the tree rebased onto master fdb6b28.

Cost of the bigger caps (wasm, same glue as t27-mcp/wasm/export.zig, zig 0.16.0 ReleaseSmall, run under node)

  • t27f.wasm: 39273 bytes before, 147819 bytes after (initial memory 49 to 53 pages). The growth is the widened arrays and the 1024-entry blank_graph, copied into three per-module SpecGraph types.
  • Exporter per call, largest specs: gf16 (436 nodes, 983 edges) 92 ms; t27core (678 nodes, 2682 edges) 250 ms; rust_convert (552 nodes, 2944 edges) 360 ms; eval (768 nodes) 99 ms. No stack overflow at the by-value graph size (about 68 KB).
  • Same small spec before and after: tri27_machine (159 nodes, 97 edges) 1.4 ms before, 12.3 ms after; ternary_deque (172 nodes, 15 edges) 0.4 ms before, 4.7 ms after. Each with_node and with_edge copies the whole graph by value, so the cost per call grew with the graph size. A typical spec stays in the low milliseconds.
  • Derive pass natively (ReleaseFast, not wired to a host): gf16 605 ms, rust_convert 223 ms, t27core 159 ms.
  • Layout (gx_view_height) on the largest spec by nodes (eval, 768 nodes): 190 ms; the layout is O(n^2) per row lookup. spec_graph_view is not changed here.

Not done

  • t27-mcp still ships the old t27f.wasm; it needs regenerating from this master (follow-up in that repo).
  • Per-call copies could be removed by a pointer-based builder API; out of scope here.

Only .t27 and prose changed; no non-t27 code.

🤖 Generated with Claude Code

…10230)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 05:29:35 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=0f8c66b9ed0e != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec(t27f): raise SpecGraph capacity to 1024 nodes and 4096 edges so every spec in the corpus is shown

1 participant