Repository navigation
feat(#115): flip and diffuse from the hand-built timeline - #120
Merged
Merged
Conversation
Adds deriveSeed (seed plus destination step, no position mix) and a pure sampleFlip wrapper around the strategy's coupled sampleStep. The worker resolves the same kernel resource as the full walk and returns one token; the store holds one in-flight step and appends through HandWalk.jump. The pinned inspector gets Flip this token with horizon, in-flight and frozen guards, an epsilon caveat, and a frozen note; its query reports the focused position's frozen flag with the visible-row rule. Checked with check, lint, prettier and vitest (675 tests, including deriveSeed, fake strategy, seeded lexical repeat and freeze cases). Plan: 1 Slice: 1/4 Kind: behavioral
Add Diffuse one step beside Undo: the worker samples every unfrozen position of the visible row once in order, from the same destination-step stream as Flip, and returns only that row. HandWalk gains a full-row append and the store appends through it with the same branch/undo semantics. The freeze helpers move into engine/freeze.ts so compute and the step share one rule. Tests cover full-row append/truncate, skipped frozen draws, a seeded differential against a naive per-position loop, and the store's append branch and cache isolation. Slice-check: 417 changed (under the 500 gate). Plan: 1 Slice: 2/4 Kind: behavioral
Extend the hand-walk smoke spec: seed-42 Flip with Enter, undo, Flip again and compare the token, Diffuse with Space, then undo. The recorded tokens are flip id 2068 and diffuse row 464, 2068, 7586, 21831. Ran `npm run e2e`: 10 passed. Slice-check: 50 changed. Plan: 1 Slice: 3/4 Kind: mechanical
Park the plan's Not doing lines, drop the promoted random-flip entry with a Promoted note to #115, add the step sampler to the map, and rewrite the HandWalk comment for full-row append. Update README and AboutPanel to describe Flip and Diffuse rather than promise them, add the session noticed line, and bump to 1.20.0. Verified with `node scripts/slice-check.mjs --budget 150`: check, lint, format and 681 tests pass; 61 changed lines. The full e2e suite passed in slice 3 (10 tests), including the flip-repeat and diffuse-step Show. Plan: 1 Slice: 4/4 Kind: mechanical
The linear schedule's beta_t is 0.0001 at t=0 and 0.02 at most, so the strategy's stay coin almost always returned the pinned token unchanged. Flip now passes beta=1 to sampleStep, forcing the active kernel's jump row; Diffuse keeps the schedule's beta_t. The e2e asserts the flipped token differs, and its seed-42 ids are recorded on PR #120. Verified: slice-check 67 changed (check, lint, prettier, 681 tests); targeted Playwright flip-repeat/diffuse test passed. Plan: 1 Slice: 1/1 Kind: behavioral
Contributor
Author
Follow-up fix: Flip now forces the jumpThe earlier seed-42 recording was made before this fix. At the default Updated seed-42 recording (same steps as the PR body):
Commit |
Contributor
Author
|
Reviewed commit: ffc2a11 Verdict: approve Blockers
Stewardship notes
What could be deleted or simplified
|
Describe the shared destination-step stream without claiming Flip and Diffuse draw the same token; Flip forces beta=1. Drop the redundant freeze test that only checked isFrozenToken with two ids. Fixes: review 1 Slice: review Kind: mechanical
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What grew
HandWalkcan now append a full sampled row as well as a one-cell jump, and a newengine/step.tssamples either one pinned position (sampleFlip) or every unfrozen position in0..L-1order (sampleDiffuse). The worker resolves the same strategy resources and freeze masks the full trajectory uses, seeded byderiveSeed(seed, destinationStep), whileTrajectoryCacheandcomputeTrajectorystay untouched. The page gains Flip this token in the pinned inspector and Diffuse one step beside Undo; both append through the existing branch semantics, so undo pops either kind.Try it
npm run dev, openhttp://localhost:5173, and click Walk it.The seed-42 Show run recorded Flip token id
2068and Diffuse row464, 2068, 7586, 21831.First place to read
src/lib/engine/step.tsfor the two samplers, thentrajectoryStore._sampleStepfor the worker round-trip and the branch check.Deviations from the issue text
sampleStepand consume no draw, so Diffuse performs one draw per unfrozen position, not one per0..L-1position. This came from the walk and keeps the full engine's freeze promise.maxSteps, not livescheduleStore.T, so a later schedule change cannot resize an existing trail.Noticed: slice 1 first measured 505 changed lines, over the 500 gate, and was trimmed to 492; slice 2 landed at 417, over the 400 target but under the gate.
Closes #115
Next: run
/reviewon this PR, then/retrospective 115after merge.