Skip to content

knowledge: Stockfish NNUE as the shipped reference for the perturbation-cascade + temporal/episodic substrate#679

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/review-claude-board-files-nhqgx1
Jul 11, 2026
Merged

knowledge: Stockfish NNUE as the shipped reference for the perturbation-cascade + temporal/episodic substrate#679
AdaWorldAPI merged 2 commits into
mainfrom
claude/review-claude-board-files-nhqgx1

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Adds one knowledge doc, .claude/knowledge/stockfish-nnue-as-perturbation-cascade.md, that grounds the workspace's Morton-cascade / inverse-pyramid perturbation-shader / HHTL / SoA doctrine in a shipped, byte-exact production instance: the stockfish-rs NNUE evaluator (E-CHESS #539 / E-CHESS-TRANSCODE-COMPLETE-1). Doc-only — no crate source, no contract type, no behavior change.

The thesis: the perturbation-cascade surface is largely CONJECTURE-as-code across the workspace, while Stockfish NNUE is a frozen (90 MB net), externally-validated instance of the same structure — base + deterministic-address-indexed perturbations over a hierarchically-addressed grid, stored SoA, updated incrementally. The frozen net is the byte-exact proof workload: a ground truth that cannot drift.

What the doc establishes (graded [G]/[H]/[S] throughout)

Spatial axis (first commit).

  • The NNUE accumulator is a genuine SoA carrier; the deterministic-phase / stored-magnitude decomposition (make_index derives which weights fire = phase; weights = the only stored bits = magnitude) matches ndarray §4's perturbation decomposition. [G] anchors named; the rest fenced as [H]/[S].
  • Fence: NNUE witnesses the magnitude side of the two-algebra rule only — it has no bipolar sign side, so it does NOT witness the Walsh-Hadamard §4b claim. Kept explicitly separate.
  • Probe-gated deliverables: D-SF-V3-1 (lift L3/L4 to a closure-parameterized reusable kernel, reference stays green), D-PALETTE-NNUE (does palette256²-quantizing the FT weight columns preserve eval within the ρ anchor? — the single highest-value probe), D-MORTON-KA, and the escalation identity (king-refresh == RouteAction::Escalate).

Temporal/episodic axis (second commit).

  • Key unification: the NNUE incremental update (apply_move) is BOTH the spatial L4 board delta AND one temporal Markov step — a game is the accumulator's trajectory through version-space, one accumulator read on two axes.
  • Mapping to the shipped temporal substrate: game = temporal.rs sorted version-stream [G]; position-at-ply = QueryReference::at(v, rung) zero-copy projection [H]; opening variants = episodic basins = le-contract L1 part_of:is_a rails [H]; transpositions = L2 memberof:members [H]; episodic recall = AriGraph EpisodicMemory [G]/[H].
  • Fence: SurrealQL AST is the query/time-series adapter over the stream, NOT the episodic spine — per the OGAR SURREAL-AST-TRAP, behavior never lives in DDL.
  • Probe-gated deliverables: D-SF-EPISODIC-1 (game as version-stream; gate = replay-to-ply-v equals compute-from-ply-v-FEN byte-for-byte, reusing the existing incremental oracle as a temporal-replay oracle at zero new ground-truth cost — the strongest probe), D-SF-BASIN-1 (transposition round-trip), D-SF-RUNG-1 (hindsight labeling via rung), D-SF-ARIGRAPH-1 (positions as episodic keys, MEASURED vs the Jirak noise floor).

Status

The doc is labeled SYNTHESIS-not-canon: the [G] anchors are real, everything else is [H]/[S] and named as such, and no deliverable ships without its probe green. It is a map of what the chess workload lets us falsify about the substrate, not a claim that the substrate is proven.

Testing

Doc-only; nothing to compile. Cross-refs verified against the sources they cite (ndarray guid-prefix-shape-routing.md §4/§4b, V3 soa_layout/le-contract.md L1–L4, temporal.rs QueryReference, AriGraph EpisodicMemory, OGAR SURREAL-AST-TRAP-PREFLIGHT.md, board E-CHESS / E-MARKOV-TEMPORAL-STREAM-1).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD


Generated by Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive technical note describing Stockfish NNUE as a reference for perturbation-cascade concepts.
    • Documented proposed accumulator behavior, incremental updates, quantization, shared computation, and tier escalation.
    • Clarified which correspondences are established mechanisms versus unverified hypotheses.
    • Outlined future probe-driven validation, temporal replay, opening classification, and episodic retrieval work.

claude added 2 commits July 11, 2026 10:33
…n cascade

Captures the operator's framing (2026-07-11): the reason to wire lance-graph +
ndarray + OGAR into the stockfish work is to learn the REUSABLE Morton-cascade /
inverse-pyramid perturbation-shader / HHTL / SoA compute — not a chess niche.

Thesis: the workspace's perturbation-shader/HHTL surface is CONJECTURE-as-code
(ndarray guid-prefix-shape-routing §3-4); Stockfish NNUE is a byte-exact
PRODUCTION instance of the same structure (base + deterministic-address-indexed
perturbations over a hierarchically-addressed grid, stored SoA, updated
incrementally), now transcoded byte-exact (E-CHESS-TRANSCODE-COMPLETE-1). So
stockfish-rs is the oracle for the reusable primitive.

Contents: the NNUE-mechanism ↔ workspace-primitive correspondence table, each
graded [G]/[H]/[S]; an honest mechanism-vs-rhyme ledger (deterministic-phase +
stored-magnitude = [G]; Walsh-Hadamard bipolar side = NO NNUE analog, fenced);
the reusable PerturbationAccumulator (ndarray mechanism / V3 policy); and a
probe-gated wiring plan (D-SF-V3-1 lift-to-closure-kernel, D-PALETTE-NNUE
tenant probe, D-MORTON-KA route probe, D-SF-V3-4 escalation identity).

Marked SYNTHESIS — not canon until the epiphany-council + a probe run.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
Extends the perturbation-cascade synthesis with the temporal axis: a chess
game is a temporal.rs version-stream, each apply_move is one Markov step AND
the spatial L4 delta (one accumulator, two axes). Opening variants = L1
part_of:is_a basins; transpositions = L2 memberof:members; episodic recall =
AriGraph EpisodicMemory. SurrealQL AST fenced as query adapter only (not the
episodic spine, per SURREAL-AST-TRAP). Four probe-gated deliverables
(D-SF-EPISODIC-1/-BASIN-1/-RUNG-1/-ARIGRAPH-1); the strongest reuses the
existing incremental oracle as a temporal-replay oracle at zero new
ground-truth cost. Graded [G]/[H]/[S]; SYNTHESIS-not-canon.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9481105e-e8ae-44e8-9014-2955b74b3c7a)

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a knowledge document describing Stockfish NNUE as a byte-exact perturbation-cascade reference, defining a reusable accumulator concept, identifying probe-gated integration work, and extending the model to temporal and episodic chess-game processing.

Changes

NNUE perturbation cascade

Layer / File(s) Summary
Mechanism correspondence
.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md
Documents NNUE mappings to workspace primitives and distinguishes established mechanisms from conjectural analogies.
Accumulator primitive and probes
.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md
Defines PerturbationAccumulator and records planned ndarray, palette, addressing, and escalation probes.
Temporal and episodic extension
.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md
Describes version-stream replay, opening basins, hindsight labeling, episodic retrieval, and related implementation references.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny with bytes in my burrow tonight,
NNUE hops through the cascade just right.
Accumulators twitch, chess versions stream,
Probes chase the pixels of a deterministic dream.
Three axes bloom where the old notes lay—
Hippity-hop, the workspace grows today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the new knowledge doc and its main themes: Stockfish NNUE as the reference for the perturbation-cascade and temporal substrate.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md:
- Line 162: Update the “position after ply v” entry to remove the “zero-copy”
claim from the QueryReference::at(...)+deinterlace description; retain the
characterization as a version-pinned projection unless the implementation and
contract are changed to avoid Vec allocation and row cloning.
- Around line 208-216: Revise the concluding paragraph beginning “Spatial (the
board)” so its claims about shared byte-exact ground truth and all three axes
are explicitly conditional on the temporal replay, rung semantics, basin
mapping, and episodic retrieval probes passing. Frame the frozen 90 MB net and
chess workload as what would close the loop if validated, rather than as
already-established results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4260cef0-56bd-468f-bd99-1f704a4beb96

📥 Commits

Reviewing files that changed from the base of the PR and between 81a5068 and 8db5e6e.

📒 Files selected for processing (1)
  • .claude/knowledge/stockfish-nnue-as-perturbation-cascade.md

| Chess object | Temporal substrate | Grade |
|---|---|---|
| A game (ply sequence) | a `temporal.rs` sorted version-stream; ply *v* = one Lance version | **[G]** — moves already carry a total order; `apply_move` IS the step |
| "position after ply *v*" | `QueryReference::at(v, rung)` + deinterlace — a zero-copy projection, no replay | **[H]** — the read is [G]; that it needs no recomputation is the D-SF-EPISODIC-1 gate |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Do not describe deinterlace as zero-copy.

The supplied implementation allocates a new Vec and clones each dispatchable row, so QueryReference::at(...)+deinterlace is a version-pinned projection but not zero-copy. Please remove “zero-copy” or update the implementation and its contract accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md at line 162,
Update the “position after ply v” entry to remove the “zero-copy” claim from the
QueryReference::at(...)+deinterlace description; retain the characterization as
a version-pinned projection unless the implementation and contract are changed
to avoid Vec allocation and row cloning.

Comment on lines +208 to +216
Spatial (the board), temporal (the game), and episodic (the archive of games) are
**three reads of one accumulator trajectory** — the same `apply_move` delta,
projected on the square axis (perturbation cascade), the version axis (Markov
stream), and the similarity axis (episodic recall). The frozen 90 MB net keeps all
three honest: every temporal projection has the same byte-exact yes/no oracle the
spatial cascade has, because replay-to-ply-*v* and compute-from-ply-*v*-FEN must
agree to the bit. That is the whole reason chess is the learning vehicle — it is
the only workload in the building where *all three axes* answer to one frozen
ground truth.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make this conclusion conditional on the probe results.

The preceding section marks temporal replay, rung semantics, basin mapping, and episodic retrieval as unvalidated gates, but this paragraph states that all three axes already share a byte-exact ground truth. Please change this to “would close the loop if the probes pass” to preserve the document’s anti-theater discipline.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/knowledge/stockfish-nnue-as-perturbation-cascade.md around lines 208
- 216, Revise the concluding paragraph beginning “Spatial (the board)” so its
claims about shared byte-exact ground truth and all three axes are explicitly
conditional on the temporal replay, rung semantics, basin mapping, and episodic
retrieval probes passing. Frame the frozen 90 MB net and chess workload as what
would close the loop if validated, rather than as already-established results.

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