Skip to content

W0 (D-DCR-0): the replay budget, measured — the mask half dominates 3.8× - #1118

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/medcare-rs-continue-6nhbxn
Aug 31, 2026
Merged

W0 (D-DCR-0): the replay budget, measured — the mask half dominates 3.8×#1118
AdaWorldAPI merged 3 commits into
mainfrom
claude/medcare-rs-continue-6nhbxn

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

W0 of dismech-causal-replay-v1 (#1117). One committed, re-runnable probe — lance-graph-contract/examples/dcr_w0_replay_budget — plus the plan/board record. No production code, no new carrier: the probe's wide bitset is an example-local fixture implementing the existing EvidenceMask trait (the trait exists to be implemented; F-RLR-2 is about the production path).

The corpus scale is read, not invented

dismech-causality-v3-v1.md §3a/§11 already measured the supervision corpus three independent ways: 2,449 oracle edges over 534 diseases, 4,076 restraint rows, 361 unknown rows. W0 reports against those magnitudes.

Measured

1. Step throughput (NarsTruth::revision + EvidenceMask::intersection): 29,184 steps/ms at a 64-wide candidate set, 14,285 steps/ms at 4,096-wide (70 ns/step).

2. Branching shrink: 1.53×–1.66× per evidence item, flat from 10³ to 10⁵ candidates — explicitly labelled fixture-set (2/3 support, 1/10 refute density). It measures the mechanism's cost and scaling, never the corpus's real discriminative power; that needs the frozen oracle/restraint TSVs (D-CV3-0..2, consumer-side).

3. KILL check — did NOT fire. Full scan of the oracle arm (2,449 chains, len 4) = 0.906 ms; one frontier decision over 64 observations = 0.008 ms, ~100× cheaper, crossover at ~25 chains. The corpus sits ~98× above crossover ⇒ W5 stays live on cost grounds (it remains HELD on the operator rung 5–9 table — a different gate). The plan pre-registered the opposite outcome as a real possibility; it was checked, not assumed.

4. Kernel split — the ALU wave's actual question. revision alone 24.0 ns vs a 4096-bit intersection+count at 90.6 ns ⇒ MASK dominates by 3.8×. The deferred p64 64×64 tile accelerates the half that actually costs, so the "4096 bits = one node's budget" shape argument survives measurement — which is not the usual outcome.

5. ALU BUY threshold (what W0 owed). The whole oracle arm replays in 2.74 ms at chain length 16 ⇒ BUY only when a workload sustains >10× that in one budget (≈143,000 steps/ms). Correctly aimed, correctly deferred.

W0 also states what it did not measure, so nobody cites it as if it had: real per-evidence discriminative power, CausalEdge64's packed step (planner-side, one dependency layer out of this zero-dep crate), and loco dispatch cost (covered by ogar-dismech's own tests; duplicating them here would be a second truth).

⊘ Correction — #1117's §0 audit was under-cited

It swept the sibling repos (F-RLR-11) but not this repo's contract module list or plans index, missing contract::dismech_evidence (686 LOC, shipped — which already carries the hidden-mediator oracle and the epistemic-restraint control, a ready-made two-sided falsifier) and dismech-causality-v3-v1.md §11 (the held-out benchmark). Nothing in the plan is contradicted — "no baked slab exists" still holds. The cost was scoping: W1–W3 would have invented a falsifier corpus that §11 already specifies. The join is now the plan's §3a: D-CV3's benchmark IS D-DCR's falsifier; D-DCR is the engine it grades. A sibling-repo sweep does not discharge the same-repo sweep — rubicon §F's own ⊘ made the identical mistake five days earlier.

Boards in the same commit: plan §3a/§3b, EPIPHANIES prepend (verified non-destructive: +61 lines, prior head entry intact), STATUS_BOARD D-DCR-0 Shipped + new D-DCR-0a; supersession index regenerated last.

Gates: contract 1278/1278, clippy --all-targets --no-deps -D warnings clean, fmt clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PFnYKqw6d7TTiB9cT8eFdK


Generated by Claude Code

Harness: lance-graph-contract/examples/dcr_w0_replay_budget (release,
deterministic LCG — a probe for a replay plan is itself replayable).
Corpus magnitudes are READ from dismech-causality-v3-v1 §11, not
re-derived: 2,449 oracle edges / 534 diseases, 4,076 restraint, 361
unknown.

Measured:
- step (NarsTruth::revision + EvidenceMask::intersection): 14,285
  steps/ms at a 4096-wide candidate set (70 ns/step).
- branching shrink 1.66x per evidence item, flat 10^3..10^5 — labelled
  FIXTURE-SET: it measures the mechanism, never the corpus's real
  discriminative power (that needs D-CV3-0..2's frozen TSVs).
- KILL check did NOT fire: scan 0.906 ms vs decision 0.008 ms,
  crossover ~25 chains, corpus ~98x above it => W5 stays live on cost
  (still HELD on the operator rung 5-9 ruling, a different gate).
- kernel split, the ALU wave's actual question: revision 24.0 ns vs
  4096-bit intersect 90.6 ns => MASK dominates 3.8x. The 64x64 tile is
  aimed at the half that costs; the whole oracle arm replays in 2.74 ms,
  so BUY is stated at >10x that in one budget. Correctly aimed,
  correctly deferred.

Also ⊘ CORRECTION: the plan's §0 audit was under-cited — it swept the
sibling repos (F-RLR-11) but not this repo's own contract module list
or plans index, missing contract::dismech_evidence (which already
carries the hidden-mediator oracle + epistemic-restraint control
populations) and dismech-causality-v3-v1 §11 (the held-out benchmark,
measured three ways). Nothing is contradicted; the cost was scoping,
and W1-W3 now consume those arms instead of inventing a corpus. Plan
§3a/§3b, EPIPHANIES prepend, STATUS_BOARD D-DCR-0 Shipped + D-DCR-0a.

Gates: contract 1278/1278, clippy -D warnings clean, fmt clean,
supersession index regenerated last.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

View limit details

Limit details: You’ve used the included review currently available. Your 63 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4635a93c-0ca0-494f-bc79-5b852df007fc

📥 Commits

Reviewing files that changed from the base of the PR and between 48d32a1 and 9e3104b.

📒 Files selected for processing (4)
  • .claude/board/EPIPHANIES.md
  • .claude/board/STATUS_BOARD.md
  • .claude/plans/dismech-causal-replay-v1.md
  • crates/lance-graph-planner/examples/dcr_w0_replay_budget.rs

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

@cursor

cursor Bot commented Aug 31, 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_bdd39c45-4bb3-4413-8a1c-b5d33ee0990e)

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da07d0ac4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/lance-graph-contract/examples/dcr_w0_replay_budget.rs Outdated
Comment thread crates/lance-graph-contract/examples/dcr_w0_replay_budget.rs Outdated
Comment thread crates/lance-graph-contract/examples/dcr_w0_replay_budget.rs Outdated
claude added 2 commits August 31, 2026 18:59
…masks, both KILL scales

All three codex findings were valid, and a fourth surfaced while fixing
them. None was a bug in the code under test; every one was a defect in
the probe's FIXTURE:

P1 the eval timed NarsTruth::revision (f32, contract-side) where the
   plan defines it as NarsTables lookup + CausalEdge64 revision.
   Disclosing the substitution did not make it the promised
   measurement. Probe MOVED to lance-graph-planner, where causal-edge
   is reachable, and now times NarsTables::revise + CausalEdge64::
   forward: 34.7 ns/step (28,818 steps/ms).
P1 the mask fixture was Bits(Vec<u64>) — a heap alloc inside every
   timed intersection — while impl EvidenceMask for [u64; N] already
   ships (revision.rs:70) and IS the p64 shape ([u64;64] = 4096 bits).
   Both are now timed and the delta reported: 61.5 ns alloc-free vs
   73.4 ns allocating (~16%).
P2 the KILL gate ran at 2,449 chains where the plan pre-registers
   10^5. Both scales now run at one candidate width; it fires at
   NEITHER (10^5: 13.88 ms scan vs 0.007 ms decision; 2,449: 0.340 ms).
   Crossover ~53 chains.
+  self-caught: dense_mask(rng, 1) sets NO bits (x % 1 == 0), so the
   frontier decision was scored against an empty live set. all_ones()
   is now its own constructor; dense_mask asserts one_in >= 2.

Net: MASK dominates by 1.77x, NOT the 3.8x v1 reported. The direction
survives (a 64x64 tile is aimed at the half that costs) but the margin
is under half the first claim, so the ALU case is materially weaker
than v1 said; BUY stands at >10x the 1.36 ms oracle arm.

Records are append-only: plan §3b kept and superseded by §3c with the
reason; STATUS_BOARD D-DCR-0 superseded in place; EPIPHANIES prepend
E-EVERY-DEFECT-IN-A-MEASUREMENT-WAS-IN-ITS-FIXTURE-NOT-ITS-CODE-1
(23888 -> 23935 lines, verified non-truncating).

Gates: planner 370/370, my example clippy -D warnings clean, fmt clean.
NOTE: workspace --all-targets clippy is red on probe_r2il_* examples
from #1051 — pre-existing, untouched here, and rust-test.yml documents
that a workspace -D warnings step would be red.
…d heat, and the reduction is why

Operator question, answered with the W0 harness instead of architecture.
Three objects are called 'masking' here and they are not the same kind:

- ogar_r2il::CallMask is [u64; 3] (192 bits, lazy word-tests, no alloc)
  => needs nothing; a slice-API call would cost more than the work.
- the replay candidate set is [u64; 64] (4096 bits) => the real
  candidate, and W0 measures it dominating the promised step ~1.8x.
- ndarray::hpc::jitson is a JSON-config -> Cranelift native SCAN kernel
  compiler, not a masking library. Relevant to W5's frontier decision,
  never to the mask half.

Measured at 4096 bits: scalar [u64;64] 65.2 ns vs ndarray
simd_int_ops::mask_and (U64x8) 60.4 ns = 1.08x, a DEAD HEAT. The
decomposition says why: SIMD and 11.1 ns + scalar popcount 56.7 ns, so
the POPCOUNT is 5.1x the AND. Borrowing the AND changes nothing because
the AND was never the cost.

The primitive that would pay does not exist: a fused
mask_and_popcount(&[u64], &[u64]) -> u32 keeping the AND in registers
and reducing with VPOPCNTDQ. ndarray has popcnt on its AVX-512 typed
wrapper but no fused slice API, and the workspace SIMD invariant means
it must be added IN ndarray, never hand-rolled here. Surfaced, not
filed — upstream asks are the operator's call.

Consequence: the deferred p64 64x64 wave's TARGET moves (fuse the
reduction, don't accelerate the op); its BUY threshold is unchanged.
Probe extended with the ndarray arm + decomposition; a >1.15x/<0.87x
band replaces the earlier faster/slower label, which called 1.00x
'FASTER'.

Gates: planner 370/370, example clippy -D warnings clean, fmt clean.
@AdaWorldAPI
AdaWorldAPI merged commit 01513d2 into main Aug 31, 2026
7 checks passed
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