Skip to content

harness: faster, narrower Waiting for model… shimmer (plan #669) - #671

Merged
btipling merged 2 commits into
mainfrom
plan/waiting-shimmer-tune
Aug 18, 2026
Merged

harness: faster, narrower Waiting for model… shimmer (plan #669)#671
btipling merged 2 commits into
mainfrom
plan/waiting-shimmer-tune

Conversation

@btipling

Copy link
Copy Markdown
Owner

Summary

Retune the Busy-row Waiting for model… shimmer (plan #669) — paint-only LUT in the Wasm harness, fully contained to text_wave.zig + its tests + one docs row. No protocol, host, rect-spinner, or cap changes.

  • Double speedSPEED = 2 inside headPosition (multiplied in u32 so phase 255*2 can't wrap u8). N*STEPS/SPEED = 27 ticks → ~2.7 s full loop at the locked HARNESS_BUSY_TICK_HZ = 10. STEPS stays 3 (no sub-char smoothing loss).
  • Narrow, localized comet — replaces the N-relative full-ring gradient (cyclicDistance, now deleted) with a directed trail behind the traveling head: HEAD_SPAN=1 acid accent head, MUTED_SPAN=2 warm_muted, DARK_SPAN=1 warm_border. The rest of the line stays warm_accent — dark occupancy drops from ~6/18 to 1/18. colorStep is now absolute-scalar and never returns 3.
  • Reduced motion / phase 0 — solid ramp[0] fast-path kept (a comet at head 0 would otherwise paint a dim trailing-edge tail); clock suffix stays solid warm_accent.

Scope: native/harness/src/{text_wave.zig,text_wave.test.zig}, docs/harness-limits.md. Host tick, STEPS, rect spinner, and protocol untouched.

Verification (Zig gates, run on host in-sandbox)

Gate Result
zig fmt --check text_wave.zig text_wave.test.zig
zig build test-rich ✅ exit 0 — text_wave test artifact green
zig build test-rich-invariants ✅ exit 0
zig build harness -Doptimize=Debug ✅ wasm32 Debug smoke

Note (environmental, pre-existing, unrelated to this PR): two test-rich child steps model_picker_layout and transcript_split_layout print failed command in this sandbox because the dvui testing backend can't load the external DejaVu Sans Symbols font. Those tests live in files this PR does not touch; they fail identically without my changes. The authoritative Wasm gate is build-harness CI on the self-hosted runner, which compiles the wasm32-freestanding release build (waiting below).

Vitest delta: None — this is a Zig-only change; no TypeScript code changed, so no vitest run is indicated (per implement-plan TS-vs-Zig scope table). Correctness gate for this layer is the Zig compile + build-harness.

Tests

text_wave.test.zig rewritten to the comet/SPEED model (+ plan tests 1–10):

  • headPosition period: N=18 returns to the same head at phase 27 (full loop = 27 ticks = ~2.7 s at 10 Hz)
  • phase * 2: phase 7 / N=10 → 4.667 (updated); phase 255 / N=20 → 10.0 via the u32 path (updated)
  • trailDistance: 0 at the head, increases behind the travel direction; rings around at the string end
  • colorStep spans: head accent / 2 muted / 1 dark / accent rest
  • far-from-head trail (≥4) is step 0, not dark
  • colorStep never returns 3 (sweep to trail 256 + boundary pin)
  • N=18 comet occupancy count: exactly 1 dark, 2 muted, 15 accent
  • N=0/N=1 → 0
  • STEPS == 3, SPEED == 2
  • phase-0 fast-path domain rationale (dim comet tail at the trailing edge)
  • kept: UTF-8 multi-byte / emoji scalar counting + countScalars pins

Operator shimmer/reduced-motion smoke (plan tests 11–12) are gated on the build-harness Preview, per the plan's DoD.

Fixes #669

…cted comet

Retune the Busy-row Waiting for model… wave per plan #669:
- SPEED=2 in headPosition (u32 multiply so phase 255*2 cannot wrap u8):
  N*STEPS/SPEED = 27 ticks = ~2.7 s full loop at the locked 10 Hz host
  tick (STEPS stays 3; HARNESS_BUSY_TICK_HZ untouched).
- Replace the N-relative full-ring gradient with a localized directed
  comet behind the traveling head: HEAD_SPAN=1 accent, MUTED_SPAN=2,
  DARK_SPAN=1 border; the rest of the line stays warm_accent. Dark
  occupancy drops from ~6/18 to 1/18. Delete the now-unused
  cyclicDistance.
- Keep the phase-0 solid fast-path (reduced motion must not show a dim
  comet tail) and the solid warm_accent clock suffix.
- Tests in text_wave.test.zig rewritten for trailDistance + new
  colorStep, updated headPosition numbers (phase 7/N10 -> 4.667,
  phase 255/N20 -> 10.0), and added the N=18 occupancy-count and
  never-returns-3 gates.
- docs/harness-limits.md Busy-spinner row: ~2.7 s loop, localized 2+1
  trail, rest accent (timeless).

Fixes #669
@btipling btipling self-assigned this Aug 18, 2026
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
invincible Ignored Ignored Aug 18, 2026 9:58pm

Request Review

@btipling

Copy link
Copy Markdown
Owner Author

Implements plan #669 (HANDOFF-READY).

  • Speed: SPEED=2 in headPosition (u32 multiply, no u8 overflow) → 27-tick loop ≈ 2.7 s at the locked 10 Hz host tick; STEPS stays 3, HARNESS_BUSY_TICK_HZ untouched.
  • Occupancy: deleted cyclicDistance; directed comet behind the head (HEAD_SPAN=1 / MUTED_SPAN=2 / DARK_SPAN=1), rest of the line warm_accent — dark drops from ~6/18 to 1/18. colorStep never returns 3 (surface).
  • Reduced motion: phase-0 solid fast-path + solid clock suffix kept.

Gates: zig fmt --check ✓ · zig build test-rich ✓ (text_wave artifact green) · test-rich-invariants ✓ · zig build harness -Doptimize=Debug ✓. build-harness CI on the self-hosted runner is green (wasm32-freestanding release + rich host unit tests — run 32156606219).

This is a Zig-only change (no TS), so no vitest delta is indicated per the TS-vs-Zig scope table.

Docs (docs/harness-limits.md) shipped in the same PR (timeless, no issue numbers). Operator shimmer smoke (plan tests 11–12) is gated on the build-harness Preview, per the plan's DoD.

Not merged per implement-plan; next steps are adversarial-review, then an explicit merge request.

@btipling btipling left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Adversarial review — PR #671

Verdict: PASS WITH NOTES
Repo: btipling/invincible
Scope: mainplan/waiting-shimmer-tune · 3 files · paint-only LUT retune (text_wave.zig + tests + one docs row)
Lenses run: L1, L3, L4, L5, L6, L8, L9 (skip L2: no API / secrets / runner / Wasm-memory trust boundary; skip L7: no config/host seams)
AGENTS.md read: yes · docs/feature-divide.md read · SECURITY.md skipped (diff does not touch workflows, secrets, runner, or API)

Findings

Sev Lens Finding Break scenario Refutation attempt Confidence
Minor L1+L9 Localized comet makes the pre-existing busy_tick 255→1 wrap a visible teleport. text_wave.zig headPosition / bridge.zig inv_set_busy_tick Start any Busy turn ≥ 25.6 s (tool-using agent turns do this constantly). Host phase maps 1..255 then wraps to 1 (never 0). For N=18: headPosition(255, 18) = (510 % 54)/3 = 8.0; next tick headPosition(1, 18) = 2/3 ≈ 0.667. The 4-scalar comet jumps ~7 glyphs in one 100 ms frame — from around for back to Wa. Old full-ring cyclicDistance gradient hid the same skip as a phase hitch; a sprite does not. Module header also claims this wrap is “after 12.8 s” (SPEED confused with wrap period); bridge.zig and docs/harness-limits.md still correctly say 25.6 s. No test pins headPosition(255, 18) vs headPosition(1, 18). Defender: wrap is pre-existing, protocol/host is out of scope, plan residual already said “ring-wrap has no dark spike.” Counter: they analyzed wrap for occupancy (still 1 border scalar — correct) and missed that deleting the full-ring gradient turns the same skip into a traveling-head pop. In-module math cannot make 255→1 continuous: period 54 does not divide 255*SPEED. Real fix is a follow-up on the u8 remap (wrap at a multiple of N*STEPS, or a wider phase), not a merge block on this paint PR. 12.8 s is comment-only and does not change runtime. high
Nit L8 Options.ramp comment still documents the old 4-stop layout [head, trail1, trail2, rest] (text_wave.zig · Options) A later caller (module advertises “generic reusable text wave”) puts rest ink in ramp[3] per the comment. colorStep now paints rest as ramp[0]; ramp[3] is never indexed. Rest of the line silently uses head color. Only in-tree caller is busy_row.zig with WARM_RAMP, where [0] is already the desired rest (warm_accent). No current user-visible miss. Comment rot, not a live break. high

Residual risk

u8 phase 1..255 will always be incommensurate with the 27-tick / 54-raw comet period, so a long turn will keep one discontinuous frame every 25.6 s until the remap changes. SPEED=2 on STEPS=3 also dwells the hard-edged head 2 frames / 1 frame / 2 frames… on successive scalars (100–200 ms) — below the bar for a finding, but the 10 Hz step the plan already called aesthetic-only. Operator smoke (plan tests 11–12) is Preview-gated and was not independently exercised here. warm_border on teal_bg is still one hard-to-read glyph; that is the requested dark stop, not a regression.

Merge guidance

  • PASS WITH NOTES: safe to merge from this attack; nits optional.
  • Do not treat the wrap teleport as a #669 blocker. If it bothers operators on long turns, file a follow-up on inv_set_busy_tick / phase width — not another text_wave occupancy tweak.
  • Fix the 12.8 s header (and the Options.ramp comment) whenever the file is next touched.

What was not attacked

Live Preview operator shimmer / reduced-motion eyeball (plan 11–12). Production Gateway. Self-hosted runner beyond reading build-harness.yml path filters + confirming run 32156606219 is green. Host setBusyTick / HARNESS_BUSY_TICK_HZ (untouched). rect_spinner LUT. Vitest (Zig-only diff; DI/cost gate N/A).

…671)

Nit (L8): fix Options.ramp comment (rest = ramp[0], not ramp[3]; text_wave uses 3 stops, not 4) and wrong 12.8 s wrap period (25.6 s at 10 Hz).

Minor (L1+L9): add headPosition(255,18) vs headPosition(1,18) test pinning the ~7-glyph teleport so a follow-up remap can measure the delta.
@btipling
btipling merged commit ea1ff52 into main Aug 18, 2026
3 checks passed
@btipling
btipling deleted the plan/waiting-shimmer-tune branch August 18, 2026 22:02
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.

plan: faster, narrower Waiting for model… shimmer

1 participant