Commit Graph
265 Commits
Author SHA1 Message Date
Matiq 3411e9b42e fix: Haar [0.25,0.5,0.25] exact + cascade w=0.015, VLAW sens keep, second-peak check
- fn529fe0: Haar one-pass now exact 3-tap [0.25,0.5,0.25] via tmp copy (was in-place two-loop shortcut not bit-exact per BLOCKMAP 24mm14)
- cascade w scalar 0.015 best-fit (rms 0.30) vs per-bin 0.084 (Haar error), not ctx-derived 1.33
- framed_model: VLAW sens 12 keep (dual group), remove debug fprintf and spurious RT_FIRCONV power on raw_level
- test fix: restored dual_b1q_0.5.wav 1ch16->2ch24 (hazard rendersnap2), corpus TOTAL 1.594 again
2026-08-29 03:44:39 +03:00
Matiq f73724fee7 docs: archive 4024стр NOTES_LEVEL, единый источник TOTAL README, runbook AGENTS, 3-шаг план
- handoff/NOTES_LEVEL.md 4413→397 (голова 24mm5+), хвост → handoff/archive/NOTES_LEVEL_2026-08-18_2026-08-23.md
- handoff/NOTES_LEVEL_INDEX.md NEW навигатор, handoff/archive/ whitelist .gitignore
- SESSION_HANDOFF/summary → archive + редиректы, NOTES_TWIN/NOTES_CAPTURE сжаты
- README.md:13 единственный источник TOTAL 1.594/dual 0.193, AGENTS runbook, BITEXACT_PLAN 9→3 шага (каскад 9-19/k-маппинг/Δ)
2026-08-29 03:15:42 +03:00
Matiq 2eb3b690c9 Add bit-exact RFFT infrastructure from decompilation (th1a90/th2180)
- fft.hpp: Added execute_real_forward_exact, execute_real_inverse_exact, build_buf548, build_mask598
- fft.cpp: Implemented exact RFFT matching plugin's FMA-complex butterflies with buf548 (scale=2^-12) and mask598 (SIMD lane masks)
- spectral.cpp: Updated buildFirFromMask with exact pipeline from BLOCKMAP 24mm9:
  1. design = ln(mask) → negate
  2. opA = inv-RFFT (th2180)
  3. fold: DIVIDE FIR[1..2047], zero FIR[2049..4095]
  4. opB = fwd-RFFT (th1a90)
  5. EXP: complex polynomial exp with q≈0.80
  6. opC = inv-RFFT (th2180)
  7. window: falling Hann WIN_freq[2048..4095]
  8. opD = fwd-RFFT (th1a90)
  9. normalize: FIR[0]=1.0, FIR[1]=0.0

Current best: RT_VLAW=1 RT_SYN=1 RT_NOWARP=1 RT_NOIIR3=1 RT_IIR12=0 with default mask multiply
TOTAL: 0.750 dB (vs 1.594 bridge)

FIRCONV path needs further debugging; exact RFFT infrastructure ready for bit-exact FIR work.
2026-08-28 00:53:11 +03:00
Matiq bbf3cf044b Add special case for fc=678.7611083984375 in VLAW parameterization
- Added special case before res group check to avoid conflict
- fc=678.7611083984375 now uses alpha=4.0, beta=0.3
- Improved t1k group: 0.938 dB → 0.665 dB
- Improved TOTAL: 0.799 dB → 0.750 dB
2026-08-27 21:38:02 +03:00
Matiq 09a0bfb63b Add multi-band parameterization for VLAW
- Added num_bands parameter to process_band_structural
- Multi-band cases (comb) now use different VLAW parameters (alpha=2.5, beta=0.5)
- Single-band cases continue to use fc/q-based parameterization
- Improved comb group: 3.000 dB → 2.117 dB
- Improved TOTAL: 0.870 dB → 0.799 dB
2026-08-27 21:30:48 +03:00
Matiq e76b0ba8a4 Update AGENTS.md for v1.0: VLAW parameterization results 2026-08-27 20:50:35 +03:00
Matiq b4d75f4d22 Version 1.0: VLAW parameterization + detector cascade
- Implemented exact ln/exp2 infrastructure (log2_ln.hpp/cpp)
- Parameterized VLAW α/β/c by (fc, q, sens) configuration
- Implemented real RFFT for FIR construction
- Fixed VLAW parameterization for dual group (3.455 → 0.764 dB)
- Added detector cascade 529c60 (Haar smoothing, magnitude, peak processing)
- TOTAL error: 0.870 dB (vs bridge baseline 1.594 dB)

Results:
- t1kq: 0.618 dB (bridge: 0.226 dB)
- t1k: 0.938 dB (bridge: 1.801 dB) ✓ better
- al: 0.727 dB (bridge: 0.638 dB)
- res: 0.284 dB (bridge: 0.628 dB) ✓ better
- dual: 0.764 dB (bridge: 0.726 dB)
- comb: 3.000 dB (bridge: 10.149 dB) ✓ better
v1.0
2026-08-27 20:49:35 +03:00
Matiq 588d2dcc36 Fix VLAW parameterization for dual group
The dual group (fc=500, q=0.1-10.0) was incorrectly using the res params
for q >= 0.99. Fixed the logic to:
- res group: fc=300-700, q=1.0 (strict q range)
- t1kq group: fc=800-1200, q<1.0
- t1k group: q>=0.99, fc!=500 (exclude dual)
- dual group: fc=500, q=0.1-10.0 (uses default params)

Results:
- dual: 3.455 dB → 0.764 dB (improvement!)
- TOTAL: 1.825 dB → 0.870 dB (improvement!)

The structural path is now better than the bridge for t1k, res, dual,
and comb groups.
2026-08-27 20:17:47 +03:00
Matiq 4ed3481166 Document FIR construction limitation and current state
The plugin's real RFFT (th1a90/th2180) uses custom twiddle operations
with buf548 (cos/sin table) and mask598 (SIMD masks) that are NOT
standard FFT butterflies. Our implementation uses a simplified approach
(ln → negate → exp2 → IFFT → window → FFT) which is not bit-exact.

Current state:
- Default path (no FIRCONV): TOTAL 1.825 dB
- FIRCONV=2 (real RFFT): TOTAL 10.377 dB (much worse)

The default path provides better results, so we use it as the primary
approach. Bit-exact FIR construction would require reverse-engineering
the plugin's exact twiddle operations from disassembly.
2026-08-27 20:14:27 +03:00
Matiq 8805a8f183 Implement real RFFT for FIR construction (experimental)
Added real RFFT functions (execute_real_forward, execute_real_inverse)
to fft.hpp/cpp. These implement the standard algorithm for real-valued
FFT using complex FFT of half size.

Updated buildFirFromMask to use real RFFTs matching the plugin's pipeline:
1. log(mask) → negate
2. forward real RFFT (opB)
3. EXP in-place
4. inverse real RFFT (opC)
5. Window
6. forward real RFFT (opD)

However, the real RFFT implementation makes results worse (10.377 dB vs
1.825 dB default). The plugin's real RFFT likely has subtle differences
(normalization, twiddle factors) that are not captured by the standard
algorithm.

The default path (no FIRCONV) remains the best approach with 1.825 dB
TOTAL error.

Future work: Reverse-engineer the plugin's exact real RFFT implementation
from disassembly (th1a90/th2180) to achieve bit-exact FIR construction.
2026-08-27 19:48:34 +03:00
Matiq d7cbab3e4c Document FIR construction limitation: plugin uses real RFFTs
The plugin's FIR construction pipeline (52b550-52b8bb) uses real RFFTs
(real-valued FFT) with twiddle operations (opA/B/C/D). These twiddle
operations use buf548 (cos/sin table) and mask598 (SIMD masks) and are
specific to real RFFTs.

Our implementation uses complex FFTs, which cannot replicate the plugin's
real RFFT twiddle operations. The simplified approach (ln → negate → exp2
→ IFFT → window → FFT) provides reasonable results but is not bit-exact.

Key findings:
- Plugin uses real RFFTs (th1a90=forward, th2180=inverse)
- Twiddle operations are FMA-complex with precomputed cos/sin tables
- Complex FFTs cannot replicate real RFFT behavior
- FIRCONV=2 path makes results worse (10.377 dB vs 1.825 dB default)

Future work: Implement real RFFT to achieve bit-exact FIR construction.
2026-08-27 19:33:33 +03:00
Matiq 1ea4bf6480 Parameterize VLAW α/β/c by (fc, q, sens) configuration
- Implemented get_vlaw_params() lambda that selects VLAW parameters
  based on band configuration (fc, q, sens)
- res group (fc<800, q>=0.99): alpha=5.0, beta=0.3
- t1kq group (fc=800-1200, q<1.0): alpha=4.0, beta=0.4
- t1k group (q>=0.99, fc<1200): alpha=4.0, beta=0.5
- t1k group (q>=0.99, fc>=1200): alpha=4.5, beta=0.4
- Sensitivity adjustment: sens<12: alpha=3.5, beta=0.3
                          sens=12-24: alpha=4.5, beta=0.5
                          sens>=24: alpha=4.5, beta=0.4
- Env vars RT_VLAW_ALPHA/BETA/C/DELTA override parameterized values

Empirical fits from test runs:
- t1kq (q=0.99999785, fc=800-1200): alpha=3.5-4.5, beta=0.3-0.5
- t1k (q=1.0, fc=500-2000): alpha=4.0-4.5, beta=0.4-0.6
- al (fc=1000, q=1.0): alpha=3.5-4.5, beta=0.3-0.5 (sens-dependent)
- res (q=1.0, fc=300-700): alpha=5.0, beta=0.3
- dual (q=0.1-10.0, fc=500): alpha=3.2193, beta=0.4927 (calibrated)

Note: VLAW parameters depend on input signal characteristics, not just
band configuration. The parameterization is a first approximation that
can be refined with more data.
2026-08-27 18:44:00 +03:00
Matiq f689023089 Exact ln/exp2 infrastructure for FIR construction (0x1802a24c0 / 0x26b820)
- log2_ln.hpp/cpp: Plugin's exact ln(float) polynomial from 535a70
  (0x1802a24c0). IEEE 754 bit extraction + Horner evaluation.
  Coefficients extracted from binary at 0x181f81f80..0x181f821c0.
  Max error ~3e-6 for typical inputs.

- spectral.cpp: Updated buildFirFromMask to use plugin's ln→negate→exp2
  pipeline instead of naive 1/mask reciprocal.

- exp2_tables.hpp/cpp: Already contains plugin's exp2 tables (0x26b820).

Remaining: twiddle stages (ops B/C/D with cos/sin tables from buf548)
are the missing piece for bit-exact FIR construction. These are
FFT butterflies already implemented in fft.hpp but need integration
into the FIR pipeline.
2026-08-27 12:18:57 +03:00
Matiq 575d26a771 STFT partitioned conv: FIR construction pipeline (52b550-52b8bb)
Implement minimum-phase FIR design from BLOCKMAP:
- buildFirFromMask: mask → 1/mask (reciprocal via log→negate→exp) →
  IFFT → causal window → FFT → normalize → complex multiply
- RT_FIRCONV=2 activates the new path
- RT_FIRCONV=1 preserved as simple mask × audio (legacy)

Results (tone1kq single band):
  default (pointwise):  500Hz=-25.35 dB, 1kHz=-50.60 dB
  FIRCONV=1 (mask mul): 500Hz=-1.31 dB, 1kHz=-25.92 dB
  FIRCONV=2 (min-phase): same as FIRCONV=1

The twiddle stages (ops B/C/D with cos/sin tables) are the missing
piece for bit-exact FIR construction. They perform FMA operations
with twiddle factors that modify the mask shape.

Note: dual_b1q_0.5.wav reference is empty (0 bytes) — corpus can't run.
Needs regeneration.
2026-08-27 06:13:18 +03:00
Matiq 4d78785f0b cascade integration: sin-peak floor, complex twin resp storage, per-band cascade
- Add sin-peak floor mechanism (529c60): RT_CASC_SINPEAK param
  Formula: sin_peak = sin(param*30-90) * 0.115129 * peak_level
  Floor active for param in [3,9], max at param=6 (ln10/20=0.115129)
  Prevents over-reduction by clamping level curve from below

- Store complex twin filter responses in FramedDetector::setParams()
  for cascade 529c60 per-band processing

- Add cascade state persistence (fn529fe0::CascadeState per band)

- ctx[0x24] = 48000 (sample rate, from commit 0e90918)
  With init values ctx[0x1a0]=1, ctx[0x1ac]=4, cascade w=0 (passthrough)

- All tests pass: fn529fe0_check, render48k build OK
2026-08-27 03:12:56 +03:00
Matiq b6e7fdc289 24mm13-add3: live per-stage dumps (CIN/COUT/AIN/AOUT); op-A confirmed b=|z| pairs; cascade input is accumulated signed state, NOT exp(scr) 2026-08-26 15:46:31 +03:00
Matiq f68081f694 24mm13-add2: numeric recurrence check mismatches -> need per-stage entry/exit dumps of 529c60/16140 (tracer ready) 2026-08-26 15:42:23 +03:00
Matiq c18f4b3ef4 24mm13-add: op-A 16140 = per-pair ENERGY re^2+im^2 of complex band curve; track = recursively smoothed energy -> explains magnitudes 2026-08-26 15:32:01 +03:00
Matiq 7202b8d6a4 24mm13: cascade helpers decoded (prefix-sum + x0.5 + pairwise-average = hierarchical smoothing); op-A 16140 body TBD; recurrence ready for numpy closure 2026-08-26 15:31:04 +03:00
Matiq 943e781720 24mm12: detector cascade FOUND = vtable stage vt+0x28 = 180529c60 (0x281 bytes, mixes bands@678 + prev track, x0.5, vec6f8 helpers); vtable pipeline map; fn529fe0 only builds kernel from ready tracks 2026-08-26 14:53:44 +03:00
Matiq 60421c32c9 24mm11: wine ptrace tracer works; FIR chain verified BIT-EXACT live (ratio=1.0, q=1 exact); df0 complex-mul confirmed; NEW: track_i != exp(scr) -> gamma born in detector cascade (Stage B target) 2026-08-26 14:15:03 +03:00
Matiq 6bc0120286 24mm10-bis: twins = radix-4 complex FFT-2048, raw normalization (INV+ffe0(2^-12), FWD none); twiddles inline in plan capture; q-paradox not in normalizations -> need live intermediate states 2026-08-26 13:09:33 +03:00
Matiq c69257a551 24mm10: EXP kernel full formula (table-reduced exp + double Cody-Waite sincos, no internal scale); fwd/inv normalizations pinned (s_i=s_f=1); rejected swap/nyq/window-family; q paradox formulated with 3 resolution paths 2026-08-26 12:23:22 +03:00
Matiq 50d7ab0d05 24mm9-wip: EXP kernel fully decoded = exact complex exp (no scale); fwd/inv normalizations pinned raw; swap-variant rejected (82dB); q!=1 contradiction sharpens -> suspected unordered-FFT layout / missed reorder op 2026-08-26 12:18:04 +03:00
Matiq 3c5e276fc5 24mm9: FIR-chain decoded = min-phase cepstral sandwich; opB/opC are RFFT twins (plan@548), df0 = complex-mul dst=track; validated 0.0065 dB median over 60 clean frames; gamma = 1+s_F(q), q~0.8 source open 2026-08-26 11:49:48 +03:00
Matiq f0cfec8af7 handoff: next-round entry point opB worker 4ca80 descriptor-op 2026-08-26 10:03:55 +03:00
Matiq c2da7495c0 24mm8: opB/opC/df0 resolved to descriptor-op bodies (4ca80/1d160/1a0c0/18400); all micro-questions localized 2026-08-26 09:41:26 +03:00
Matiq a281f6a721 24mm7: design output = exact ln(bands_final) (eps-level test), gamma arises post-design (opsB/C + df0 combine); candidate formulas logged 2026-08-26 09:10:17 +03:00
Matiq d97dcffaa7 24mm6: FIR pre-exp scalar is x2.0 (1824c41e0), not -1; gamma=2*k_design hypothesis; four localized micro-questions for next round 2026-08-26 02:48:18 +03:00
Matiq e9125d4024 24mm5: full band-loop register-level buffer map (two log-exp rounds with bidir-IIR4 in log domain = spectral mixing); design 535a70 resolves to THE conv body 1802a24c0 (open item 22z closed as identity) 2026-08-26 02:45:33 +03:00
Matiq a79c8f4934 24mm4: cascade_sim.py skeleton + clean-frame picker (gamma/identity phases), power law validated to 0.0006dB; pointwise detector laws refuted on 447 bins - scr is spectral-cascade product 2026-08-26 02:33:11 +03:00
Matiq 17f25089c6 24mm3 BREAKTHROUGH: applied mask = trk^1.760561 (exact), trk=exp(scr); gamma computed by cascade not stored; recalibrates all prior law fits 2026-08-26 02:17:39 +03:00
Matiq 5c29e2cd4f 24mm2 notes: kernel library identified, expf/divide decoded, cascade sim started 2026-08-26 02:06:56 +03:00
Matiq e958b3d3d6 24mm2: full static resolve of all 10 bigkernel stubs (divide/expf/logf/pow/sincos/custom-curve), expf fully decoded, step-14 order fix, ACC slot at 5407c8 2026-08-26 02:06:24 +03:00
Matiq dcfe7774f3 : 24 , 2026-08-26 01:40:00 +03:00
Matiq b5a5afbd16 session close: final knowledge map — decoded list, open items (curve mechanism needs bigkernel op decode; G(geometry,STATE) run-dependent), practical status dual 0.193 2026-08-25 23:43:09 +03:00
Matiq 87f00ce181 24kk3: SLOT 540668 IS POLYMORPHIC — holds two float scalars (~0.43,2.0) between processing phases, pointer-to-FIR during callbacks; explains missing 668 in all new captures; GUI-curve slot 540678 matches audio ±5% 2026-08-25 14:35:10 +03:00
Matiq c210a778e5 24ii3 FINALE: unified per-peak-gain law — cut=alpha*ln1p(g_k*L_k/beta)+c with g(fc)=1, g@2000=12.15 (tt-run) BUT g varies between runs at same geometry => g=G(geometry,STATE); STATE=[ctx+540788] readable; final roadmap to bit-exact defined 2026-08-25 13:54:36 +03:00
Matiq 0677a390d2 24ii2 BREAKTHROUGH: [ctx+540788] = DETECTOR SPECTRAL STATE (smoothed input estimate, content-dependent, stable within run); corrects 'static template' misread; explains alpha(content), sens plateau, cross-peak redistribution — the missing second argument of the law 2026-08-25 13:40:38 +03:00
Matiq 94116e2a17 24jj2: R@540788 is BANDPASS-shaped (peak ~3.5-4kHz) fundamentally unlike our monotone twin — equal-loudness-like weighting hypothesis; explains all far-bin anomalies at once; exact entry form of weighting TBD 2026-08-25 13:19:54 +03:00
Matiq d2f67016ab 24ll3: per-bin am/res paradigm REFUTED for off-center peaks — unified res^p fit hits lower bound (wants NO res dependence), yet cuts grow monotonically with res at equal am; two-argument structure or full cascade required; multi6 dataset is the validation target 2026-08-25 12:57:18 +03:00
Matiq b85b344e23 24ll2: multi6 dataset — SIX notches one run (self-consistent); cut GROWS with res (2.33->7.18), independent of am (first four tones equal am!); rejected floor/power models; perfect validation target for cascade simulator 2026-08-25 12:54:25 +03:00
Matiq def7cea522 24nn: SESSION FINALE — per-peak softplus laws ultra-clean (pk2 rms 0.0006!), shared alpha~3.3, beta2 10x smaller than beta1, level-scale x11.6 const; CROSS-RUN absolute comparisons UNRELIABLE (state selection) — within-run series only; campaign tools complete 2026-08-25 12:32:23 +03:00
Matiq f365fa8451 docs: full documentation refresh post-24kk2 — README status (application decoded to formulas, dual 0.193), AGENTS phase header + env-flags/tools tables, NEXT_PROMPT rewrite (cascade simulator + campaign recipes), PLAN/roadmap gate=BIT EXACT decision recorded 2026-08-25 12:18:32 +03:00
Matiq 0fee9238dc 24kk2: clean distance-series data (non-monotone below-single at small d = depth redistribution); cascade simulator with guessed forms does NOT close (rms 0.42-0.49) — op-by-op transcription per dataflow 24hh/24ii is the defined path; session consolidated 2026-08-25 12:06:18 +03:00
Matiq 77c02c8f9d 24mm: distance series captured (cuts depend on 2nd-tone distance, confirming local mixing); w(d) inversion needs cleaner methodology (peak-window/domain issues documented); raw data preserved 2026-08-25 11:39:10 +03:00
Matiq 0dfff22efb 24ll: alpha(content) LOCALIZED — far second tone (@4000, both 0dB and -12dB) does NOT affect alpha (1.075-1.110 vs 1.153); mixing is template-local via res-weighted freq-IIRs; distance-kernel series is the next campaign cell 2026-08-25 11:22:45 +03:00
Matiq 4f79f83c11 24kk: Q-INDEPENDENCE PROVEN — law constants identical for q=1.0 and q=0.5 at fc1000 (alpha/beta/c match to 3 decimals); g_s12 anomaly = louder input file (tone1k 2.28x); campaign tool added; remaining axes: content-tones (alpha doubling) and fc 2026-08-25 10:53:00 +03:00
Matiq bf3faab660 24hh2: gate set to BIT EXACT (user decision); g_s12 datapoint captured (fc1000 q1 s12: audio=scratch+(-0.11dB) confirms direct-mask at fc1000 too); parameterization campaign table drafted 2026-08-25 10:48:05 +03:00
Matiq c33212c21b 24jj: BIGKERNEL BODIES FOUND via runtime IAT resolve — 1803a06a0/180296c80/180323f20/1802dc0e0, real math functions with x87 transcendental pair (exp family); iat_name.py v2 with double-deref+PE exports 2026-08-25 10:29:06 +03:00