v7.13.1 — Beat Matrix endpoint fix: full 16x10 grid, no phantom dot past the wall

This commit is contained in:
Z User 2026-11-05 08:44:59 +00:00
parent 05d2c626ca
commit 9cea959a52
5 changed files with 75 additions and 5 deletions

Binary file not shown.

View file

@ -16,9 +16,11 @@
// EMBEDDED_SEED_VERSION: bump whenever this library is regenerated — the // EMBEDDED_SEED_VERSION: bump whenever this library is regenerated — the
// GET /api/presets route re-seeds the root/embedded subtree when it changes // GET /api/presets route re-seeds the root/embedded subtree when it changes
// (v7.10: em dashes in descriptions/script comments replaced with '--'; // (v7.10: em dashes in descriptions/script comments replaced with '--';
// v7.12: eleventh Zai-Magic preset "osc-rotations" added). // v7.12: eleventh Zai-Magic preset "osc-rotations" added; v7.13.1: Beat
// Matrix grid endpoint fix — the last point no longer lands one column past
// the wall and the rightmost column keeps its bottom dot).
export const EMBEDDED_SEED_VERSION = '7.12' export const EMBEDDED_SEED_VERSION = '7.13.1'
export interface EmbeddedPreset { export interface EmbeddedPreset {
folder: string folder: string
@ -1304,8 +1306,14 @@ chroma = frac(chroma + beat * 0.166)
flash = exp(-beatage * 5) flash = exp(-beatage * 5)
[point] [point]
col = floor(i * cols) # i spans 0..1 INCLUSIVE (AVS convention), so floor(i*cols) sends the very
row = floor(frac(i * cols) * rows) # last point to col 16 -- one column past the wall -- and leaves the
# rightmost column without its bottom dot. Mapping through CELL CENTERS
# (k + 0.5) puts every floor() half a cell away from an integer boundary,
# so no point can ever spill or shuffle, even under float dust.
cell = i * (cols * rows - 1) + 0.5
col = floor(cell / rows)
row = floor(cell - col * rows)
lvl = getspec(col / cols, 0, 0) lvl = getspec(col / cols, 0, 0)
frombottom = (rows - 1 - row) / rows frombottom = (rows - 1 - row) / rows
lit = if(below(frombottom, lvl * 1.15), 1, 0) lit = if(below(frombottom, lvl * 1.15), 1, 0)

View file

@ -39,6 +39,16 @@ export interface ReleaseNote {
} }
export const RELEASE_NOTES: ReleaseNote[] = [ export const RELEASE_NOTES: ReleaseNote[] = [
{
version: '7.13.1',
name: 'Beat Matrix grid fixed',
changes: [
{
kind: 'fixed',
text: 'The rightmost column of Beat Matrix no longer sits one row short. Its last dot used to land one column past the wall\u2019s right edge while the column itself was left without its bottom dot -- a classic off-by-one between the grid math and the engine\u2019s inclusive 0-to-1 point range. I rebuilt the mapping through cell centers, so all 16 columns now carry their full 10 dots, perfectly aligned.',
},
],
},
{ {
version: '7.13', version: '7.13',
name: 'One build, every feature', name: 'One build, every feature',

View file

@ -12,6 +12,30 @@
// warns in the console when the two drift apart. // warns in the console when the two drift apart.
// //
// History: // History:
// 7.13.1 — Beat Matrix endpoint fix (user report): the rightmost column
// of dots sat one row short -- its bottom dot missing -- while a
// phantom dot spilled one column past the wall's right edge at
// the top. Root cause: the engine's point position i spans 0..1
// INCLUSIVE (classic AVS Superscope convention, engine.ts: i =
// k/(n-1)), but Beat Matrix's grid math assumed exclusive i = k/n:
// floor(i*cols) turned the last point into col 16 (one past the
// 16-column wall) at row 0, and column 15 was left with nine
// dots (rows 0-8, no bottom). Fix: the script now maps through
// cell centers -- cell = i*(cols*rows-1)+0.5, col =
// floor(cell/rows), row = floor(cell-col*rows) -- which puts
// every floor() half a cell away from an integer boundary, so
// the endpoint can never spill and float dust can never shuffle
// a dot. Full 16x10 bijection verified headlessly (all 160
// points in 160 distinct cells, col<=15, row<=9, bottom-right
// cell present). Sweep of the other 100 presets: every other
// floor(i*M) use is benign -- angular presets close their loop
// (bar=bars lands exactly on bar 0's angle), Aurora Veil's
// phantom lands off-screen (x=1.19), the megabuf particle
// presets draw their phantom slot at alpha 0, and the converted
// Winamp classics rendered identically under original AVS
// (which also uses inclusive i). EMBEDDED_SEED_VERSION 7.12 ->
// 7.13.1 re-seeds the library so every visitor gets the fixed
// Beat Matrix.
// 7.13 — one build, every feature: the parallel development lines are // 7.13 — one build, every feature: the parallel development lines are
// merged. This tree now carries BOTH the community OVE-Directory // merged. This tree now carries BOTH the community OVE-Directory
// (v7.11 here) AND the parallel line's additions — the spectrum // (v7.11 here) AND the parallel line's additions — the spectrum
@ -407,4 +431,4 @@
export const APP_NAME = 'Open Visualization Engine' export const APP_NAME = 'Open Visualization Engine'
export const APP_SHORT = 'OVE' export const APP_SHORT = 'OVE'
export const APP_VERSION = '7.13' export const APP_VERSION = '7.13.1'

View file

@ -2328,3 +2328,31 @@ E2E (agent-browser + pixel measurement + VLM, ALL PASS):
Stage Summary: Stage Summary:
- v7.13 shipped: the parallel line is merged — the spectrum 16 kHz cap, the screen wake lock, the respectful Demo button, the one-click Save with auto-naming + rename dialog, the AVS-style background movement family (bgrot/bgx/bgy/bgzoom) and the eleventh Zai-Magic preset "osc-rotations" all run in the same build as the community OVE-Directory, with one clean version timeline (the parallel wake-lock release folded in as 7.10.2). Only three files needed hand-merging; every engine-side change is byte-identical to its validated original. - v7.13 shipped: the parallel line is merged — the spectrum 16 kHz cap, the screen wake lock, the respectful Demo button, the one-click Save with auto-naming + rename dialog, the AVS-style background movement family (bgrot/bgx/bgy/bgzoom) and the eleventh Zai-Magic preset "osc-rotations" all run in the same build as the community OVE-Directory, with one clean version timeline (the parallel wake-lock release folded in as 7.10.2). Only three files needed hand-merging; every engine-side change is byte-identical to its validated original.
---
Task ID: 41
Agent: main (Z.ai Code)
Task: v7.13.1 (user report): in Zai-Magic "Beat Matrix" the rightmost vertical line of dots sat offset +1 upwards -- its bottom dot did not line up with the other columns, and its top dot spilled over onto the next section to the right. Diagnose, explain, fix.
DIAGNOSIS (why the right column was short and a phantom dot spilled):
- The engine's point position i spans 0..1 INCLUSIVE (classic AVS Superscope convention; engine.ts: i = k/(n-1)). Beat Matrix's grid math assumed exclusive i = k/n: col = floor(i * cols) sends the LAST point (i = 1 exactly) to col 16 -- one column past the 16-column wall (x = 0.986/aspect vs the wall edge 0.87/aspect) at row 0 (top), reading getspec(1.0); and column 15 was left with only 9 dots (rows 0-8, no bottom: its lowest dot sat at y = -0.62 while every other column reaches y = -0.81). Verified headlessly before the fix: col 15 = 9 dots rows 0-8, col 16 = 1 dot, bottom-row y spread col 14 vs 15 = 0.19 script units.
- Sweep of all other floor(i*M) uses in the library (62 occurrences): every other one is benign -- angular presets close their loop (bar = bars lands exactly on bar 0's angle: seg*tau/segs with seg = segs = 2pi = 0), Aurora Veil's phantom lands off-screen (x = 1.19 > 1), the megabuf particle presets (Bass Bloom, Supernova) draw their phantom slot at alpha 0 (uninitialized megabuf reads 0), Strobe Lattice/Tunnel Vision/Prism Chandelier hide one endpoint dot in rotating/mirrored chaos, and the converted Winamp classics rendered identically under original AVS (which also uses inclusive i) -- their authors saw and accepted exactly this behavior. Beat Matrix was the only hand-authored ALIGNED grid where the defect is obvious, so it was the only one that needed the fix.
Work Log:
- embedded-presets.ts Beat Matrix [point]: the grid mapping now goes through CELL CENTERS -- cell = i * (cols * rows - 1) + 0.5, col = floor(cell / rows), row = floor(cell - col * rows). Because i = k/(n-1) over n = cols*rows points, cell = k + 0.5 exactly (up to 1-ulp dust), so every floor() sits half a cell away from an integer boundary: the endpoint can never spill and float dust can never shuffle a dot into a neighboring cell. getspec/x/y/hue all read col/row as before (col 0..15, row 0..9; the last point now lands at col 15 row 9, the author's original intent under i = k/n). A 6-line comment in the script documents the why.
- EMBEDDED_SEED_VERSION 7.12 -> 7.13.1 (library re-seed replaces the DB's Beat Matrix; verified in SQLite: seed = 7.13.1, 106 presets, fixed content present, old mapping gone).
- version.ts 7.13.1 + history entry; release-notes.ts 7.13.1 "Beat Matrix grid fixed" (fixed, first-person voice).
HEADLESS VALIDATION (/home/z/tmp-validate/beatmatrix/validate.mts, ALL PASS — REAL parser/compiler, not a re-implementation):
- Regression guard: all 101 embedded presets still compile.
- The fixed Beat Matrix [point] program executed over all 160 points with the engine's exact i = k/(n-1): 160/160 cells occupied, ZERO duplicates, max col 15, max row 9, bottom-right cell (15,9) present, all 16 columns carry their full 10 rows, 16 distinct x symmetric about 0, 10 distinct y rows aligned.
BROWSER E2E (agent-browser + 8-frame max-brightness composite + VLM, ALL PASS):
- Fresh load: title "OVE -- Open Visualization Engine (v7.13.1)"; /api/presets re-seeded on the version gate; Beat Matrix loads (PTS 160 = 16x10) and plays on the demo track (FPS 57-60, BPM 133.5 locked).
- Pixel lattice analysis of an 8-frame composite (captures the treble moments when the high-band columns light): exactly 16 dot columns detected, even 38-39 px gaps; the BOTTOM dot of every one of the 16 columns sits at the SAME pixel row (y = 619, spread 0 px) -- the row-9 position that only exists under the fix (the old code's col-15 lowest dot sat ~80 px higher).
- Phantom-dot check: the old spill position (x ~722, top row) shows ZERO bright pixels across the composite (x 710-750 all 0); the only brightness right of the wall is column 15's own glow decaying monotonically to nothing by x = 710 (175 -> 45 -> 0 bright-pixel counts), i.e. additive-blend glow, not a dot. The fullscreen-overlay icon (x >= 757) is outside the lattice zone.
- VLM on the composite: "16 columns"; bottom row fully lit across all 16 columns at the same height (clean straight bottom edge); no stray dot right of the rightmost column; no alignment defects.
- What's New dialog: 7.13.1 "Beat Matrix grid fixed" first with CURRENT badge; drift guard silent (0 console errors / 0 warnings across the session); dev.log clean (200s only). Test-browser localStorage cleared afterwards.
Stage Summary:
- v7.13.1 shipped: Beat Matrix's wall is whole -- every column carries its full 10 dots, the bottom edge is straight across all 16 columns, and the phantom dot that spilled past the right edge is gone. The fix lives in the preset's grid math (cell-center mapping, immune to the inclusive-endpoint and float dust alike); the engine's AVS-correct i convention is untouched, and the library re-seed delivers the fixed preset to every visitor.