phase A: reduction law found (affine in dB), canon unchanged; keep RT_DUMP tooling

- Effective reduction is affine in dB(lvl): x_exp2 = -0.6646 - 0.05877*dB
  (mask ~ 0.8*lvl^-0.354, gamma ~= decomp 0.344); tones +-0.13 dB over 42 dB
- Pre-IIR calibrated variant (X0=1.8/S=0.11): TOTAL 2.633 vs HEAD 2.286;
  wins t1kq/t1k/al/comb, loses res/dual -> gate fails, canon stays LUT
- Grid search (X0,S,floor,CMAX) on validated trajectory model: no scalar
  law of the family fits tone+noise simultaneously (res tension)
- Refuted: high-bin/IIR3-backward propagation, direct-affine bypass,
  positive floors, ceilings
- Kept opt-in instrumentation RT_DUMP_BIN / RT_DUMP_ALL for Step 7 capture
- Docs: NOTES_LEVEL 21d, BITEXACT_PLAN s.0 note, roadmap, AGENTS
This commit is contained in:
2026-08-21 19:29:21 +03:00
parent 702b74e297
commit 3e5085e06d
5 changed files with 136 additions and 1 deletions
+66
View File
@@ -1296,3 +1296,69 @@ Do NOT tune MULT further — it is calibrated; the CURVE SHAPE is wrong.
### FFT-conv priority DOWNGRADED: NOTES:18c shows window 0x540658 tail is
near-flat (0.8->1.0 plateau at N/2>=2048), FIR-construction effect on mask
shape minimal for N=4096. Step 4 stays P3.
## ============ UPDATE 2026-08-21d: REDUCTION-LAW DISCOVERY + Phase A closure ============
### Discovery: effective reduction is AFFINE in dB(level)
RT_DUMP_BIN tracts (frame 100) across al sweep fit:
x_exp2 = -0.6646 - 0.05877 * dB(lvl_raw) (mask ~ 0.8 * lvl^(-0.354))
gamma_eff 0.354 ~= decomp BandConfig gamma 0.344 (NOTES:967) -> power law,
NOT the double-exp t^gamma->exp2 form (21c). Tone-levels verified +-0.13 dB.
### Pre-IIR application calibrated through chain model
Python simulator (tables from rt_mask_tables.cpp; IIR1 fwd, IIR2 fwd, exp2*0.8,
W, IIR3 bidi x2): pre-IIR affine peak dilutes ~2.3x by spatial IIRs ->
X0=1.8, SLOPE=0.11 (max|x-resid| 0.09 ~= +-0.5 dB on tones).
FULL CORPUS fresh-build A/B (stale-binary protocol, both reproduce exactly):
group old(HEAD LUT) new(affine pre-IIR)
t1kq 0.768 0.460 v
t1k 2.114 1.196 v
al 0.986 0.132 v (all 6 levels |e|<=0.25)
res 0.437 2.046 x
dual 3.264 4.317 x
comb 6.116 5.718 v
TOTAL 2.286 2.633
### Phase A experiments (ALL on fresh builds / validated models)
1. res regression is REAL (not stale binary; reproduced both directions).
2. High-bin/IIR3-backward propagation hypothesis REFUTED: at frame-100 the
two laws give IDENTICAL masks on res_500 (<1e-4 everywhere); divergence
lives in other frames' level zone (-13..+15 dB) where old cuts more.
3. Direct-affine (bypass IIR1/2, raw constants) REFUTED: TOTAL 2.777.
Spatial IIRs are integral to the effective curve.
4. Offline trajectory model (RT_DUMP_ALL per-frame lvl_raw; chain sim;
metric-window frames [55,90)/[243,278) @48k/1024-hop; zero-pad frames
excluded — they are beyond the trimmed output!) VALIDATED: known-law
predictions within 0.09..0.19 dB on res_500/al_24/t1k_1000 (al_12 0.53).
5. Grid search over affine family (X0, SLOPE, floor F>=0, ceiling CMAX),
objective = sum pred_err^2 over anchored cases:
OPTIMUM X0=2.00 S=0.0825 F=0 CMAX=inf -> rms 0.75 dB with
res_500 +0.84 / al12 +0.29 / al24 -1.21 / t1k -0.02.
Ceiling never active in-grid; positive floors do NOT help (top all FL=0).
### KEY NEGATIVE RESULT
NO law of the scalar affine family fits tone AND noise content
simultaneously (res tension +0.4..+1.1 unavoidable). Old Pchip "wins" on
res/dual/comb via error cancellation, not shape correctness; affine wins
tones decisively (al +-0.13 dB linearity over 42 dB!). The missing piece is
CONTENT-DEPENDENT behavior: detector dynamics (att/rel interplay with
fluctuating spectra), or combine/acc consumer (multiband feedback), or
saturation mechanism. => Gate "no group regression" FAILS for every family
member -> committed canon stays HEAD (LUT g=0.344/m=4.2).
### Tooling kept (opt-in env, zero cost when unset)
- RT_DUMP_BIN=<path> [RT_DUMP_FRAME=n]: single-frame tract dump (7 cols).
- RT_DUMP_ALL=<path>: append per-frame binary lvl_raw spectra
[i32 frame][i32 nbin][f32 x nbin]. Use ONE env per run (BIN early-return
eats ALL frames if combined!). rm target first (append mode).
Captures live under /tmp/opencode/traj_*.bin (law-independent detector).
- Offline engine: /tmp/opencode/phaseA_grid_fast.py (combo-vectorized chain
sim + grid search); estimator zoo: phaseA_estimator_zoo.py.
### NEXT (Phase B candidates, priority order)
1. Detector dynamics: att/rel on fluctuating spectra vs ref renders of
noise-like material (res group) — per-frame gain extraction protocol
ready (STFT ratio out/in at metric bin, see phaseA session notes).
2. Step 7 live capture ctx+0x188 (constants + possible content-dependent
branch), NOTES_CAPTURE.md method.
3. combine consumer hunt (multiband cascade) for dual/comb.