cascade 1c: chain_9_19 skeleton DIVIDE/FMA/EXP proxy, ready for vpermps/poly

This commit is contained in:
2026-08-29 15:31:59 +03:00
parent 04c51e5be0
commit d025fa5a23
2 changed files with 39 additions and 0 deletions
+34
View File
@@ -154,6 +154,40 @@ void cascade_detect(
std::memcpy(bands_curve, acc, nbin * sizeof(float));
}
// ---- Main chain 919 (BLOCKMAP:620, 540 table, 52a583-52b3a0) ----------------
// Structural proxy — math-exact via numpy-equivalent cores; bit-exact C++
// port will replace k_div/k_exp with vpermps+poly 1803a06a0 / 180296c80
// (BLOCKMAP:580/569) and FMA triples re/im/coef 1fa0/1940 (BLOCKMAP:400).
// ACC pointer table @0x5407c8 (slot rendered in rendersnap2.py) holds
// per-frame band ACC_i vectors for step 10 (dc40).
void chain_9_19(float* bands, float* tmp6f8, float* accVec,
const float* warp, const float* att, const float* rel,
size_t nbin) {
// 9a: vec698 *= (1 - param87c) → zero при дефолтах (param=1.0)
// 9b: vec6f8 += param87c*0.8 @1824c3e28 (BLOCKMAP:589)
// 9c: DIVIDE dst=678i A=bands B=6f8 1803a06a0 vpermps (BLOCKMAP:580)
for (size_t i = 0; i < nbin; i++) {
float a = bands[i] != 0 ? bands[i] : 1e-30f;
float b = tmp6f8[i] + 0.8f; // 9b proxy
bands[i] = b / a; // k_div_exact proxy
}
// 10: vec6f8 = bands - ACC_i dc40 tbl@5407c8 (BLOCKMAP:596)
for (size_t i = 0; i < nbin; i++) tmp6f8[i] = bands[i] - accVec[i];
// 11: FMA ATT/REL upper/lower 1fa0/1940→3c40 (BLOCKMAP:400) re/im/coef 12B
for (size_t i = 0; i < nbin; i++) {
tmp6f8[i] += att[i] * accVec[i]; // upper
tmp6f8[i] += rel[i] * accVec[i]; // lower
}
// 14: EXP#1 180296c80 expf + +=(-1) th2270 (24mm2 order fix)
for (size_t i = 0; i < nbin; i++) bands[i] = std::exp(bands[i]) - 1.0f;
// 15: array-mul track* th2000
// 16: *=kWarp + LOG#2 140980 (placeholder warp already passed)
for (size_t i = 0; i < nbin; i++) bands[i] *= warp[i];
// 17: EXP#2 + exp-variant 140a40/140b00
for (size_t i = 0; i < nbin; i++) bands[i] = std::exp(bands[i]);
}
// ---- Legacy structural chain (pre-cascade) ---------------------------------
void iir1(float* x, const double* A, const double* B, size_t nbin, double acc0) {