The least-significant-bit scale correction that turns the reconstructed latent into
the synthesis-input latent:
likely[c,block] = clamp( (sum_8x8 |i_s| + 32) >> 6, 0, 4351 ) // per 8x8 block
y_lsbs[c,p] = yhat + ( t0[likely]·(yhat - resi) + t1[likely]·resi ) / 2^13
Recovered scale_log = i_s (the hyper_scale decoder output) empirically: of the
candidate scale quantities, only i_s makes the block table-index reproduce the
reference (i_s+rvs etc. diverge to ~54 dB; i_s hits machine precision). Blocks are
8x8 with the reference edge-pad value 1411; the +32 >>6 is round-to-nearest of the
block sum (arithmetic shift, same floor semantics as the rest of the scale path).
Validated on the real test256.bin checkpoint (yhat_y, resi_dq_y, i_s, the two LSBS
tables) vs the reference y_lsbs: max|Δ| = 0.000000 (float-exact). Plus unit tests for
the block index, the additive, and the [0,4351] table clamp.
This closes the latent path end to end: entropy → dequant → sigma → SGMM reconstruct
→ LSBS → the y_lsbs that feeds synthesis (already validated at 58.85 dB on real data).
Co-Authored-By: Claude Opus 4.8 <[email protected]>