From c46f3a11683e96c51857e7991034ea8e3aa78b28 Mon Sep 17 00:00:00 2001 From: gramps Date: Fri, 4 Sep 2026 12:37:26 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20HANDOFF=20=E2=80=94=20de-duplicate=20th?= =?UTF-8?q?e=20sliced-6/7=20history=20paragraph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HANDOFF.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/HANDOFF.md b/HANDOFF.md index 19a9bc9..1b2215e 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -52,14 +52,14 @@ RealApp boot-smoke. Scope-check passed. not cache keys. Tests: `PasteCache_...` + 85/85 across compositor/pump/chat/capture/session classes; clean build 0 warnings. (Cam bypasses the cache via IsOpaque; revisit if take 9 is borderline. Follow-ups unchanged: vertical-tier alloc, debounced chat re-render on bursts.) -3. **Take 9/10 + slices 6-7 (2026-09-04):** slice 6 broke the 15.6ms Task.Delay sleep quantum (timeBeginPeriod + bulk-sleep + 2ms spin tail + wait stat); take 10's `wait 10ms after render 22ms` then exposed the FINAL structural bug: the pump loop's await-continuations inherited the UI SynchronizationContext — the "WPF-free" producer had been rendering ON THE DISPATCHER, queued behind the live preview, the whole time (explains every 'zero change' complaint). Slice 7: Task.Run the loop (OBS pattern) + StaticPixelCache lock + chat raster-miss marshalled to dispatcher + SustainedLowLatency GC + `worst render` stat + webcam through paste cache. Test `Pump_Produces_OffTheStartingContext`. 70/70 green, clean build. paste cache moved render 26.5→22.4ms yet - period stayed ~37ms — the gap is Task.Delay's ~15.6ms Windows sleep quantum padding every sub-tick - wait. **This is why takes 7→9 read as "zero change" despite real wins: the sleep floor dominated.** - Fixed (media-app canon, cited in code + MyMistakes #3): timeBeginPeriod(1) for the pump's life - (paired End in finally), sleep the bulk, SPIN the last 2ms across the deadline; stats gained - `avg wait` so render+submit+wait ≈ period (accounting closed — nothing can hide). Webcam now - routes through the paste cache too (bypass re-sampled 156k px even between identical device - frames). 52/52 per-class green, clean build 0 warnings, committed this slice. +3. **Slices 6-7 (2026-09-04, committed):** slice 6 broke the 15.6ms Task.Delay sleep quantum + (timeBeginPeriod + bulk-sleep + 2ms spin tail + `avg wait` stat — the quantum had capped the + producer at ~27fps and made two real render wins read as "zero change"). Slice 7 then resolved + take 10's impossible math (`render 22 + wait 10` vs a 16.7 deadline): the pump's continuations + inherited the UI SynchronizationContext — the loop had been rendering on the dispatcher behind + the live preview the whole saga. Task.Run the loop (OBS pattern), StaticPixelCache locked, chat + raster-miss marshalled to the dispatcher, SustainedLowLatency GC, `worst render` stat, webcam + through the paste cache. Tests Pump_Paces/Pump_Produces_OffTheStartingContext; 70/70 green. 4. **Take 11 ran + slice 8 (2026-09-04, committed with the audio unit below):** off-UI loop WORKED — typical frames land exactly on the deadline (work ~10 + wait ~6.8 = 16.7; 212/300). Remaining gap = periodic 35-65ms spikes growing across the take = gen2 GC pauses; the capture