Skip to content

T=274 Spike A+C: write-path benchmarks + language-neutral replay-equivalence gate - #66

Draft
MSD21091969 wants to merge 2 commits into
masterfrom
claude/prog-lang-rewrite-choice-lr2m8m
Draft

T=274 Spike A+C: write-path benchmarks + language-neutral replay-equivalence gate#66
MSD21091969 wants to merge 2 commits into
masterfrom
claude/prog-lang-rewrite-choice-lr2m8m

Conversation

@MSD21091969

Copy link
Copy Markdown
Collaborator

What

Test-files-only companion to the ffs0 T=274 engine-language round (dev/design/manifold-bump-4_0/DECISION-engine-language.md there). No production source change; go.mod untouched — the "stdlib + quic-go only" invariant holds.

Spike A — benchmarks (internal/hdc/spike_a_bench_test.go, internal/fold/spike_a_bench_test.go)

Quantifies the write-path costs the T=263 ceiling report attributed to codec/allocation rather than language. Measured (linux/amd64, Go 1.24.7, 4 vCPU):

Measurement Result
Full-state HDC encode, per-node path (300 nodes/600 rels, TypeExpressions) ~1.2–1.3 s, ~7.3 GB allocated per call — invoked twice per rewrite under the write lock (runtime.go:971, :1068)
Same state via the existing-but-unused batch path (EncodeNodes) ~0.33 s, 147 MB — ~4× time, ~50× allocation
Codebook cold (NewEncoder() per call, 256 URNs) vs warm 43 ms vs 1.2 ms
GraphState.Clone() 1k nodes/2k rels · 5k/10k 2.7 ms / 2.15 MB · 19.6 ms / 10.3 MB — ×(N+1) per N-step program
Bind (10k float32, by value) 6.8 µs ≈ 1.5 GFLOP/s scalar

Spike C — replay-equivalence acceptance gate (internal/fold/replay_fixture_test.go, testdata/replay/)

Committed 12-entry JSONL log exercising all four rewrite types, the idempotent-skip path (duplicate ADD), additive MUTATE via PropertySpec, and a WF15 contract LINK; golden canonical state (Nodes + Relations, sorted-key JSON) + SHA-256:

6bb67afc79b23155cb79a38a0be74ed5c5685a5f519b5e081a128300a81e6d90

Any candidate engine, in any language, reproduces this hash from the same JSONL or is not an engine. Goldens regenerate via MOOS_UPDATE_GOLDEN=1; semantic spot-checks prevent a regenerated golden from silently blessing a broken fold. The fixture .jsonl is force-added past the repo-wide *.jsonl ignore (rule untouched).

Verification

  • go test ./... — green, all packages.
  • go test -run TestReplayFixtureT274 -count=2 ./internal/fold/ — deterministic, hash stable.
  • go test -bench=SpikeA -benchmem ./internal/hdc/ ./internal/fold/ — produces the table above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PB5ZxREJGN8QHmSR2J4Cig


Generated by Claude Code

claude added 2 commits August 2, 2026 11:45
…e gate

Spike A (bench-only, no production change): quantifies the write-path costs
named by the T=263 ceiling report — full-state HDC encode via the per-node
path is ~1.2s / ~7.3 GB allocated per call at 300 nodes (run twice per
rewrite under the write lock); the existing-but-unused EncodeNodes batch
path is ~4x time / ~50x allocation better; fresh-codebook regeneration is
43ms vs 1.2ms warm per 256 URNs; GraphState.Clone() is 2.7ms/2.15MB per
rewrite at 1k nodes, x(N+1) per N-step program.

Spike C: testdata/replay/t274-fixture.jsonl (all four rewrite types,
idempotent-skip duplicate ADD, additive MUTATE via PropertySpec, WF15
contract LINK) + golden canonical state + SHA-256
6bb67afc79b23155cb79a38a0be74ed5c5685a5f519b5e081a128300a81e6d90.
Any candidate engine reproduces the hash from the same JSONL or is not an
engine. Context: ffs0 dev/design/manifold-bump-4_0/DECISION-engine-language.md.

go test ./... green; go.mod untouched (stdlib + quic-go only holds).

authored-by: agent:claude-code.remote / session:none-ungoverned-remote-s0 / t274-engine-language-choice
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PB5ZxREJGN8QHmSR2J4Cig
The repo-wide *.jsonl ignore (for ephemeral state snapshots) also caught the
committed test fixture; the golden and hash landed without the log they fold.
Force-adding the fixture only — the ignore rule itself is untouched.

authored-by: agent:claude-code.remote / session:none-ungoverned-remote-s0 / t274-engine-language-choice
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PB5ZxREJGN8QHmSR2J4Cig
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.

2 participants