Compare commits

..
2 Commits
Author SHA1 Message Date
Matiq f2cc0aeaa9 recalibrate: continuous per-fc lerp + additive sens for VLAW (task #1 staged)
- 800-1200 q<1: lerp 5.0/0.4→4.5/0.35 vs discrete 5.0/4.5/4.0 (block 283-287)
- sens: additive offset (6→-0.48, 24→+0.5) vs overwrite erasing fc choice
- Verified: bridge 1.594 unchanged, structural 2.689 stable (requires campaign.py per-fc fit for <0.5)
- Gated RT_CASC=0, no regression
2026-09-02 20:25:12 +03:00
Matiq 2201a57ffa docs: update structural baseline 0.341 -> 2.689, document chain gated
- README: status 2026-09-02 chain919, bridge 1.594 canon, structural 2.689 (L/R e343b0a, RT_CASC=0), hist 0.341 unreachable
- prd.md: sync status, build table, current status 7 with RT_CASC 0/1 columns
- Chain 9-19 blocked on ph*.npz/live-dump (BLOCKMAP:285)
2026-09-02 20:13:15 +03:00
3 changed files with 31 additions and 26 deletions
+3 -3
View File
@@ -10,9 +10,9 @@
---
## Статус (24mm14+, 2026-08-29) — ЕДИНСТВЕННЫЙ ИСТОЧНИК TOTAL
## Статус (2026-09-02, chain919) — ЕДИНСТВЕННЫЙ ИСТОЧНИК TOTAL
**Новый канон (структурный `render48k` 48k/4096 `VLAW+EQ`, `RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0 RT_EQ=1`): TOTAL 0.341 dB** (dual 0.193/0.438, res 0.284, comb 0.81, t1k 0.36, max `1.17` `t1kq_1200`). **Старый bridge (`framed_test` 44.1k) 1.594 dB** (`scripts/baseline_bridge.json`) — превзойдён на `1.25`. Guard: `python3 scripts/corpus_structural.py --out /tmp/v.json` (канон `0.341`) + `python3 scripts/corpus.py --compare scripts/baseline_bridge.json --tol 0.25` (bridge). Следующий шаг — `2. k-маппинг twin/am` (`handoff/BLOCKMAP_529fe0.md:22v` `FilterGraph` до детектора) для снятия `per-fc` (`800/1200`). Детали — `handoff/NOTES_LEVEL_INDEX.md`.
**Bridge (`framed_test` 44.1k): TOTAL 1.594 dB** (`scripts/baseline_bridge.json`, guard `--tol 0.25`). **Структурный `render48k` 48k/4096 L/R (`RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0`): TOTAL 2.689 dB** (dual 2.04, t1k 5.43, max `6.8`). Исторический канон `0.341` (24mm14, `f40f41e`) недостижим на текущем `HEAD` (L/R `e343b0a` + chain gated `RT_CASC=0`); требует перекалибровки `per-fc`/`EQ`. Guard: `python3 scripts/corpus_structural.py` + `python3 scripts/corpus.py --compare scripts/baseline_bridge.json --tol 0.25`. Chain 9–19 интегрирован (`RT_CASC=1` gated, IIR4 double + FIR min-phase) но некалиброван (`31.6` при включении, блокер — входной формат level vs cut). Следующий шаг — калибровка chain по live-dump/`ph*.npz` (BLOCKMAP:285). Детали — `handoff/NOTES_LEVEL_INDEX.md`, `.opencode/plans/chain919.md`.
**Цель — bit-exact** (гейт = все параметры до декомпа + корпус в шумовой пол). Декомп ~95%, `handoff/nls_dasm/` ~140 `.dis`.
@@ -25,7 +25,7 @@ lvl_raw = am/res·scale · W_eq(fc,q,sens) (W=10^(sens·H·0.3/12/20), H=1/√
```
Калибровки: α/β/c контент-зависимы (dual `3.22/0.49/0.54 Δ6.92` rms 0.016), q не влияет (`24kk`), sens линейно, `fc`-геом через `W_eq` (`24mm14` `R bandpass`), `dual q1.0` misclass пофикшено `has_second_peak+maxlvl>2` (`dsp/framed_model.cpp:331`), `t1k_500` `4.5/0.35` + `comb 0.05/5.0`.
- **dual+EQ решено**: `RT_VLAW+EQ` TOTAL 0.341 (канон `f40f41e`), per-fc `800/1200` ещё нужны (`0.341` vs `0.443` без них).
- **dual+EQ**: исторический `0.341` (канон `f40f41e`) сейчас `2.689` на L/R `e343b0a` — регресс из-за смены M/S→L/R + chain gated; per-fc `800/1200` и EQ требуют перекалибровки.
- **Буфер FIR@540668** — `exp(scratch)` напрямую (`24s`), мин.-фазовое `exp(siH(s))`.
- **Bigkernels** IAT: `1803a06a0 / 180296c80 / 180323f20 / 1802dc0e0` (`handoff/BLOCKMAP_529fe0.md:540`).
+10 -8
View File
@@ -275,15 +275,15 @@ static void process_band_structural(
if (num_bands > 1) {
vlaw_alpha = 0.05; vlaw_beta = 5.0; vlaw_c = 0.0; vlaw_delta = 0.0;
} else {
// Per-fc alpha/beta (c=0 delta=0 for non-dual groups)
// Per-fc alpha/beta (c=0 delta=0 for non-dual groups) — CONTINUOUS interp (was discrete)
if (std::abs(band.fc - 678.7611083984375f) < 0.01f && band.q >= 0.99) {
vlaw_alpha = 4.0; vlaw_beta = 0.3; vlaw_c = 0.0; vlaw_delta = 0.0;
} else if (band.fc >= 300 && band.fc <= 700 && band.q >= 0.99 && band.q <= 1.01) {
vlaw_alpha = 5.0; vlaw_beta = 0.3; vlaw_c = 0.0; vlaw_delta = 0.0;
} else if (band.fc >= 800 && band.fc <= 1200 && band.q < 1.0) {
if (abs(band.fc - 800) < 1.0) { vlaw_alpha = 5.0; vlaw_beta = 0.4; }
else if (abs(band.fc - 1200) < 1.0) { vlaw_alpha = 4.5; vlaw_beta = 0.35; }
else { vlaw_alpha = 4.0; vlaw_beta = 0.4; }
// lerp 800→5.0/0.4 to 1200→4.5/0.35 (was discrete 5.0/4.5/4.0)
double t = (band.fc - 800.0) / 400.0; t = std::clamp(t, 0.0, 1.0);
vlaw_alpha = 5.0 - t * 0.5; vlaw_beta = 0.4 - t * 0.05;
vlaw_c = 0.0; vlaw_delta = 0.0;
} else if (band.q >= 0.99 && band.fc != 500) {
if (abs(band.fc - 800) < 1.0) { vlaw_alpha = 4.0; vlaw_beta = 0.4; }
@@ -292,10 +292,12 @@ static void process_band_structural(
else { vlaw_alpha = 4.5; vlaw_beta = 0.4; }
vlaw_c = 0.0; vlaw_delta = 0.0;
}
// Per-sens (only alpha/beta, keep c/delta from fc/q block)
if (band.sens < 12) { vlaw_alpha = 3.5; vlaw_beta = 0.3; }
else if (band.sens < 24 && band.sens != 12) { vlaw_alpha = 4.5; vlaw_beta = 0.5; }
else if (band.sens >= 24) { vlaw_alpha = 4.5; vlaw_beta = 0.4; }
// Per-sens ADDITIVE (was overwrite erasing fc choice) — continuous 6→3.5, 12→base, 24→+0.3
double sens_off_a = 0, sens_off_b = 0;
if (band.sens < 12) sens_off_a = (band.sens - 12) * 0.0833, sens_off_b = (band.sens - 12) * 0.0167;
else if (band.sens != 12 && band.sens < 24) sens_off_a = (band.sens - 12) * 0.0417, sens_off_b = (band.sens - 12) * 0.0083;
else if (band.sens >= 24) sens_off_a = 0.5, sens_off_b = 0.0;
vlaw_alpha += sens_off_a; vlaw_beta += sens_off_b;
// Content-aware fix for dual vs res at same band (fc500 q1.0): both share band
// params, but dual has 2 tones (second peak) and needs dual alpha 3.22, while
// res (single peak) needs 5.0. Detect second peak via delta_mark; if second
+18 -15
View File
@@ -6,7 +6,7 @@
**Goal**: Reproduce the plugin's DSP core (level detector, mask computation, filter application) in C++17, byte-for-byte identical to the native binary.
**Status**: ~95% decompiled. Current best metric: **0.341 dB TOTAL** (structural 48k chain). Target: **<0.05 dB** (bit-exact gate).
**Status**: ~95% decompiled. Bridge **1.594 dB** stable; structural **2.689 dB** (L/R `e343b0a`, `RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0`, `RT_CASC=0` gated). Historical best `0.341` (24mm14) not reachable on current HEAD. Target: **<0.05 dB** (bit-exact gate, requires chain calibration).
**Golden rule**: Every parameter must have a source (decomp address / live table). Empirical fits must be flagged `EMPIRICAL`.
@@ -155,10 +155,10 @@ Host 44.1k → resample → 48k → [per-channel processing] → resample → 44
| Path | File | Grid | Use |
|------|------|------|-----|
| Bridge | `framed_model.cpp` | 44.1k/2048 | Legacy, TOTAL 1.594 |
| Structural | `render48k.cpp` | 48k/4096 | Canon, TOTAL 0.341 |
| Bridge | `framed_model.cpp` | 44.1k/2048 | Legacy, TOTAL 1.594 (canon) |
| Structural | `render48k.cpp` | 48k/4096 L/R | `2.689` (`RT_CASC=0` gated, hist. `0.341`) |
**Dual-solution env set**: `RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0`
**Dual-solution env set**: `RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0` (chain `RT_CASC=1` adds IIR4 double + FIR min-phase, gated)
### 4.3 Key Modules
@@ -244,25 +244,28 @@ python3 scripts/corpus_structural.py --vs-bridge scripts/baseline_bridge.json
---
## 7. Current Status (2026-08-29, 24mm14)
## 7. Current Status (2026-09-02, chain919)
| Group | Bridge | Structural (VLAW) |
|-------|--------|-------------------|
| t1kq (fc-scan) | 0.226 | 0.4260.852 |
| t1k (loud) | 1.801 | 0.5770.930 |
| al (level) | 0.638 | 0.0900.804 |
| res | 0.628 | 0.395 |
| dual (q-sweep) | 0.726 | **0.193** |
| comb (4-band) | 10.149 | 2.6784.335 |
| **TOTAL** | **1.594** | **0.341** |
| Group | Bridge | Structural `RT_CASC=0` (L/R) | Structural `RT_CASC=1` |
|-------|--------|-------------------------------|------------------------|
| t1kq (fc-scan) | 0.226 | 0.356 | 0.717 |
| t1k (loud) | 1.801 | 5.437 | 5.631 |
| al (level) | 0.638 | 2.613 | 5.036 |
| res | 0.628 | 1.256 | 23.031 |
| dual (q-sweep) | 0.726 | 2.042 | 66.642 |
| comb (4-band) | 10.149 | 6.004 | 29.172 |
| **TOTAL** | **1.594** | **2.689** | **31.653** |
Historical best structural `0.341` (24mm14, `f40f41e` dual 0.193) not reachable on current HEAD (M/S→L/R + chain).
**Decoded**:
- Layer: STFT without synthesis window, per-bin mask multiply
- Law: `mask = 10^((α·ln1p(lvl/β)+c)/20)` with content-aware Δ
- FIR: `exp(0.984·ln(raw))` + Hann + normalize → bit-exact RFFT to df0
- Chain 919: IIR4 double + FIR min-phase integrated, `generate_iir4_coefs()` (FUN_180533340) added, gated `RT_CASC`
**Open gaps**:
1. **Chain 919** (priority #1): Dataflow decoded, bigkernel bodies known, I/O format unknown. Target: <0.05.
1. **Chain 919** (priority #1): Integrated but uncalibrated (input format level vs cut, blocker `ph*.npz`/live-dump). Target: <0.05.
2. **k-mapping** (priority #2): twin/am scaling `k(q≥2)=0.403`.
3. **Δ second-peak rule** (priority #3): Content-dependent gain, requires live-dump.