Handoff: reconcile docs and tooling with the corrections made this session
Session 2 reversed several of its own conclusions. The docs are append-only, so a reader could land on a superseded section and act on it. This pass makes the repo internally consistent. Defects found and fixed in STATUS.md: - claimed "Hybrid VQ with k=1024: no" as the answer to the linework question, directly contradicting FINDINGS 14, which rejected k=1024. Both profiles are k=256. - malformed profile table (six column separators, five columns). - next-steps list had two items numbered 3 and listed the full-disc survey twice. - the disk-benchmark section still read CRITICAL-PATH with "if SCSI sustains >=800 KB/s, ship pixel-exact". That was written while the bandwidth figure was misread as 4 MB/s. At 4 Mbps pixel-exact needs 92-97% of the pipe and is not available, and the ring-buffer result means the design no longer hangs on the benchmark at all. Rewritten with what it IS still worth doing: confirming the 4 Mbps provenance, and confirming DMA is used rather than PIO. FINDINGS now carries supersession blockquotes on 5, 8, 11, 17 and 18 pointing at the sections that correct them. 18 is the dangerous one -- its peak-vs- sustained test is reversed by 21 -- so it is marked DO NOT ACT ON THIS SECTION while noting the per-frame data itself remains valid. profile_gen.py had the same problem in code: it defaulted to the superseded peak sizing and returned lam=25 where the docs say lam=10. The buffered test is now the default and peak sizing is behind --size-for-peak as a bound only. A tool that contradicts the findings is worse than no tool. Also preserves the five measurement scripts that produced this session's numbers as tools/analysis/05-09, following the session 1 precedent, and adds an "explicitly abandoned -- do not re-propose" list to STATUS covering entropy coding, k=1024 codebooks and flat 4x4 VQ. Claude-Session: https://claude.ai/code/session_01194oWYW8DQXK1SZ2DnChW6
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""Ring-buffer simulation. The peak-vs-sustained comparison in FINDINGS 18 was
|
||||
the wrong test: with SD-backed SCSI the fill rate is a CONSTANT, and a burst
|
||||
frame is absorbed by the buffer rather than having to arrive within one frame.
|
||||
|
||||
What actually matters:
|
||||
1. required PREFILL so the buffer never underruns mid-scene
|
||||
2. STALL TOLERANCE at a branch point -- Dragon's Lair seeks between streams,
|
||||
and the buffer drains while the seek completes
|
||||
"""
|
||||
import sys; sys.path.insert(0,'tools/encoder')
|
||||
import vq_hybrid as H, ratectl as RC, numpy as np
|
||||
S=sys.argv[1]; BW=4_000_000/8/1024; FPS=12
|
||||
fill=BW/FPS
|
||||
print(f"fill {BW:.0f} KB/s = {fill:.2f} KB per frame time\n")
|
||||
print(f'{"scene":8}{"lam":>5}{"mean":>8}{"max f":>8}{"prefill":>9}{"stall @0KB":>12}{"stall @256KB":>14}')
|
||||
for s in ['00010','00020','00146','00181']:
|
||||
m=H.build(f'{S}/fr_{s}',k1=256,k4=256,iters=16)
|
||||
for lam in [10.,60.]:
|
||||
e=H.encode(m,lam=lam)
|
||||
kb=e['sizes']/1024 + RC.AUDIO_KBPS/FPS # KB demanded per frame
|
||||
# cumulative deficit: worst shortfall of supply vs demand
|
||||
deficit=np.maximum.accumulate(np.cumsum(kb-fill))
|
||||
prefill=max(0.0,deficit.max())
|
||||
# stall tolerance: with buffer B prefilled, how many frame times can the
|
||||
# fill be zero (seeking) before the buffer empties, at mean drain
|
||||
mean_kb=kb.mean()
|
||||
stall0 = prefill/mean_kb if mean_kb>0 else 0
|
||||
stall256 = (256.0+0.0)/mean_kb
|
||||
print(f'{s:8}{lam:5.0f}{kb.mean()*FPS:8.1f}{kb.max():8.2f}{prefill:9.1f}'
|
||||
f'{stall0:9.1f} fr{stall256:11.1f} fr')
|
||||
print()
|
||||
print("prefill = KB the buffer must hold before playback starts")
|
||||
print("stall = frame times the buffer survives with NO fill (seek/branch)")
|
||||
print(" at 12fps, 1 frame = 83.3 ms")
|
||||
Reference in New Issue
Block a user