Skip to content

hpc: the first and last cut are the rolling floor's change indicator - #329

Merged
AdaWorldAPI merged 2 commits into
masterfrom
claude/llvm-codegen-polyfill-gni3cw
Sep 24, 2026
Merged

AdaWorldAPI merged 2 commits into
masterfrom
claude/llvm-codegen-polyfill-gni3cw

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #328.

What changes

Drift is now read at the bucket boundaries. FIRST_CUT (1σ) and LAST_CUT (3σ) are located through the active shape twice: once at the anchor, once at the current coordinates.

  • Equal motion of the two cuts means translation.
  • Unequal motion means dilation or narrowing.
  • CutDrift carries both motions and the (Δμ, Δσ) they decompose into:
    • Δσ = (ΔT_first − ΔT_last)·σ / (off_first − off_last)
    • Δμ = ΔT_first − off_first·Δσ/σ
    • On the Gaussian lattice these reduce to Δσ = (ΔT_first − ΔT_last)/2 and Δμ = ΔT_first + Δσ, exactly.
  • cut_drift() exposes the indicator on demand.

Cuts decide WHETHER, moments decide WHERE

  • MomentsU32 owns the facts, and the first and last cut own the drift decision. Recalibration adopts the exact current facts.
  • A checkpoint raises a shift when the cut-implied |Δμ| > σ/2 or |Δσ| > σ/4 of the anchor.
  • The FloorShift it raises carries the exact running coordinates (run_mu, run_sigma), never anchor + cut-implied Δ. recalibrate() anchors on those.
  • CutDrift.d_mu / d_sigma are diagnostics:
    • Gaussian: the exact parameter decomposition.
    • Empirical: a cut-implied, effective decomposition, quantized by the reservoir's rank resolution. It is not the actual statistical parameter change.
    • Collapsed cuts: when both cuts sit at one offset, spread motion is unobservable by this ruler, so the effective d_sigma is 0.

Behaviour

  • Gaussian path: the drift decisions match the previous running-vs-anchor parameter test, and the shift coordinates are unchanged.
  • Empirical path: motion is judged in the learned geometry. A dilation that the two cuts cannot express moves no bucket boundary, so it is not drift.
  • Resolution: the cut-based Δσ is only as sharp as the gap between the two cuts' offsets. In the test's bimodal sample an 80-unit dilation reads as 84. That is fine for the indicator, and it no longer reaches the anchor.

Tests

  • 31/31 pass locally (debug x86-64).
  • cuts_decide_whether_moments_decide_where pins the separation. With an empirical shape at an anchor of σ=316 and an actual +80 dilation:
    1. the ruler reads (Δμ, Δσ) = (6, 84);
    2. that reading crosses the σ/4 = 79 criterion;
    3. FloorShift equals the exact (run_mu, run_sigma), not (μ+6, σ+84);
    4. after recalibrate(), the anchor equals the exact MomentsU32 coordinates.
  • checkpoint_drift_is_what_the_cuts_see now expects the exact σ of a constant stream (0, floored to 1), not the anchor's 8.
  • Disable run: restoring the anchor + Δ construction turns both of those tests red.
  • The v3/v4/aarch64 runs, the no_std build and the bench were not run locally, so CI covers them.

🤖 Generated with Claude Code

https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm

Drift is read at the bucket boundaries: FIRST_CUT (1σ) and LAST_CUT (3σ)
are located through the active shape at the anchor and at the current
coordinates. Equal motion is translation; unequal motion is dilation.
CutDrift carries both motions and the (Δμ, Δσ) they decompose into,
Δσ = (ΔT_first − ΔT_last)·σ/(off_first − off_last), Δμ = ΔT_first −
off_first·Δσ/σ. A checkpoint shifts on |Δμ| > σ/2 or |Δσ| > σ/4.

On the Gaussian lattice this reproduces the running-versus-anchor
parameter test exactly (every pre-existing drift, cadence, batching and
legacy-oracle test is unchanged). Through an empirical shape the motion
is judged in the learned geometry: a dilation the ruler cannot express
moves no bucket and is not drift. cut_drift() exposes the indicator on
demand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: e154cd66-8ae4-43c7-a0dd-f3f2ec98925d

📥 Commits

Reviewing files that changed from the base of the PR and between 07c7b4b and 96f1132.

📒 Files selected for processing (1)
  • src/hpc/rolling_floor.rs
 _____________________________________
< No code too small, no bug too tall. >
 -------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

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

@cursor

cursor Bot commented Sep 24, 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_cf964493-1e92-4f4a-bf72-10176cd53263)

The checkpoint built FloorShift from anchor + the cut-implied (d_mu,
d_sigma). On the empirical path that decomposition is quantized by the
ruler's rank resolution (an actual 80-unit dilation reads as 84), which
is fine for a change indicator and wrong for a new anchor when the exact
MomentsU32 coordinates are already in hand.

The cut motion still decides WHETHER a shift is raised; the shift now
carries the exact running coordinates, and recalibrate() anchors on them.
CutDrift.d_mu/d_sigma are documented as diagnostics: exact on the
Gaussian lattice, effective and quantized through an empirical shape,
zero spread when the two cuts collapse to one offset.

Regression test cuts_decide_whether_moments_decide_where pins the
separation. checkpoint_drift_is_what_the_cuts_see now expects the exact
sigma of a constant stream (0, floored to 1) instead of the anchor's 8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 24, 2026 22:59
@AdaWorldAPI
AdaWorldAPI merged commit 7988793 into master Sep 24, 2026
19 of 20 checks passed
@cursor

cursor Bot commented Sep 24, 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_9edd6d4e-01aa-4cf0-952a-305cda8b9ed9)

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