Skip to content

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

Closed

Description

@gHashTag

SpecGraph holds at most 192 nodes and 254 edges (#10180), so about 2 percent of the corpus is still refused with ERR_TOO_MANY_NODES: the biggest specs (gf16 436 nodes, t27core 678) are exactly the ones a reader most wants to see. The owner wants big specs shown, not refused.

Measured on the Railway lab over all 2225 specs/**/*.t27 files at master 538df07, through the exporter and then the derive pass (#10198), on a scratch build with caps of 2048 nodes and 8192 edges so that nothing is refused: nodes p50 20, p90 65, p95 93, p98 191, p99 444, p999 720, max 775; edges p50 18, p90 118, p95 211, p98 371, p99 531, p999 1573, max 3194. All 2225 specs validate. The largest by nodes is specs/igla/coder/eval.t27, the largest by edges is specs/tools/t27o/rust_convert.t27.

This issue raises MAX_NODES to 1024 and MAX_EDGES to 4096 (headroom of 1.3x and 1.28x over the measured maximum), moves the edge endpoint arrays and the NO_INDEX sentinel from u8 to u16 where the old limit forced it, and keeps refusing, never truncating, anything past the new caps. Epic: gHashTag/trinity#1648. Predecessors: #10180 (192/254), #10162 (exporter), #10198 (derive).

Boundary

  • specs/t27f/spec_graph.t27
  • specs/t27f/spec_graph_export.t27
  • specs/t27f/spec_graph_derive.t27
  • specs/t27f/spec_graph_fold.t27
  • .claude/skills/t27f/SKILL.md

spec_graph_derive.t27 and spec_graph_fold.t27 (landed in #10228 while this was in review) are in the Boundary only for the minimum a wider index forces: their as u8 casts at with_edge, stale comments, and (derive) two capacity tests that hard-coded 192 and 254. spec_graph_view.t27 and spec_graph_outline.t27 are NOT touched: the view reads indices as u32, so it adapts as it stands.

User Scenarios

  • Given any spec in specs/ when the exporter and the derive pass read it then validate_graph answers GRAPH_OK and the graph keeps every node and edge.
  • Given a spec with 1025 nodes or 4097 edges when the exporter scans it then the verdict is ERR_TOO_MANY_NODES or ERR_TOO_MANY_EDGES and no truncated graph is returned.
  • Given a graph with a node past index 255 when an edge names it then the edge is stored with its exact endpoint and the graph validates.

Requirements

  • FR-001: MAX_NODES MUST be 1024 and MAX_EDGES MUST be 4096; every fixed array in SpecGraph and in the exporter's name-span table MUST have that length.
  • FR-002: edge_from and edge_to MUST be u16 arrays, with_edge MUST take u16 endpoints, and NO_INDEX MUST be 65535; an invariant MUST state that both caps stay below NO_INDEX and keep at least 25 percent headroom over the measured maximum.
  • FR-003: A graph exactly at each cap MUST be valid and one past it MUST be refused, tested in spec_graph, from real source text in spec_graph_export, and through the derive pass in spec_graph_derive.
  • FR-004: The measured distribution and its method MUST be written next to the constants in spec_graph.t27, and SKILL.md MUST state the new limits.
  • FR-005: The PR MUST state the wasm size and the per-call time of the exporter on the largest specs, before and after.

Success Criteria

  • t27c test-report reports 0 vacuous and 0 failing tests for spec_graph, spec_graph_export, spec_graph_derive, spec_graph_outline, spec_graph_view and spec_graph_fold.
  • t27b test --check (qemu-aarch64) reports 0 failed tests for the same six specs.
  • Exporter plus derive validate 2225 of 2225 specs in specs/ on the lab.
  • The pull request touches 0 files outside the Boundary section, adds 0 lines of non-t27 code, and leaves spec_graph_view.t27 unchanged.

Activity

  1. added a commit that references this issue on Oct 18, 2026
    8b38651
  2. added a commit that references this issue on Oct 18, 2026
    d41572c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions