Skip to content

Commit cd8fdfc

Browse files
fix(analyzer): match core 2.3.5 dotted waves and FPS context
1 parent ee80427 commit cd8fdfc

6 files changed

Lines changed: 591 additions & 6 deletions

File tree

‎docs/plans/2026-10-05-predictor-visual-loop.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,26 @@ Documentation assessment: shipped README/Pages collection instructions remain
244244
unchanged because this experimental prediction run changes no shipped ranking
245245
or collection. This plan and the analyzer research evidence record the results;
246246
no new production accuracy or compatibility claim is added.
247+
248+
## Round004 diagnosis: dots and equation FPS
249+
250+
The native quad profile draws built-in wave dots as one centered 2px point;
251+
the source used four shifted 1px copies. Correct the explicit 2.3.5 low-resolution
252+
profile while preserving canonical historical drawing and rejecting unsupported
253+
engine/viewport requests. The dot-only diagnostic makes Hyperspace frame 2 match
254+
exactly and lowers 60-frame RGB8 mean error from 2.951 to 0.416.
255+
256+
The clock cadence is 30 Hz but native equation FPS starts at 35, with the JNI
257+
tracker setting 30 only after rendered image 30. A frozen fps/256 shader control
258+
matches all native pixels: red 35 for images 1–30, red 30 for 31–60. Retain
259+
physical PCM/FFT arrays and timestamps and provide that separate equation
260+
context. With the original frozen 63-module model and only FPS input corrected,
261+
187's missing red fan returns; mean RGB8 error falls from 1.130 to 0.0083, maximum
262+
2. Adding the correct context to Hyperspace's dot repair lowers mean RGB8 error
263+
further to 0.112, but residual maximum 23 remains. No diagnostics receive fresh
264+
acceptance credit; original grades stay unchanged. Point-grid snapping and
265+
motion-vector quads remain separate declared gaps.
266+
267+
Evidence: `tools/milk-analyzer/fixtures/visual-loop-dot-fps-repair-2026-10-06.json`.
268+
Analyzer README records the input/drawing contracts; shipped collections and
269+
Pages instructions do not change. Focused drawing/geometry tests pass 35 checks.

‎tools/milk-analyzer/README.md‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,29 @@ that layer inactive through height 1330; above it, Native trails also use a
287287
or scaled lines. Every forecast with the 2.3.5 engine identity rejects viewports
288288
above the 1024x768 reference area or height 1330, even with the canonical line
289289
profile or a declared lab equation seed. Accepting the low-resolution identity
290-
does not establish 4K support or appearance accuracy. The new 2.3.5 round has not
291-
yet been frozen; the original 2.3.4 slots 016–018 were withdrawn before captures.
290+
does not establish 4K support or appearance accuracy. The first 2.3.5 batch,
291+
slots 019–021, scored 97.5/17.5/65 under the frozen behavioural rubric. The
292+
original 2.3.4 slots 016–018 were withdrawn before captures.
293+
294+
With the exact 2.3.5 engine and the GLES quad profile, built-in dotted waves use
295+
one centered 2-pixel point at or below the reference area. The earlier model
296+
used four offset 1-pixel copies. The canonical profile retains those historical
297+
copies; quad-dot requests with other engine identities or larger viewports are
298+
rejected. Correcting only this draw path makes Hyperspace's second frame match
299+
the saved native white frame exactly and reduces its 60-frame RGB8 mean error
300+
from 2.951 to 0.416. This is diagnostic evidence, not fresh acceptance credit.
301+
302+
Separate PCM cadence from the equation `fps` input. In the declared cold JNI
303+
test host, the engine starts with target FPS 35. The JNI tracker updates it after
304+
the 30th rendered image at simulated time 1 second. Supply equation FPS 35 for
305+
images 1–30 and 30 for images 31–60 while retaining the 30 Hz PCM arrays and
306+
timestamps. A separately frozen `q1=fps/256` control through the unchanged AAR
307+
matches the expected red bytes 35 then 30 on every pixel. This timeline describes
308+
that exact host lifecycle, not arbitrary app startup or device frame rates.
309+
Correcting only this input in the unchanged frozen model restores `187`'s red
310+
fan; its 60-frame RGB8 mean error falls from 1.130 to 0.0083, with maximum 2.
311+
See `fixtures/visual-loop-dot-fps-repair-2026-10-06.json`. Point snapping and
312+
motion-vector quad rasterization remain separate gaps.
292313

293314
A frozen curved-line native control agrees within one RGB8 level over 60 frames.
294315
The full case 012 diagnostic now matches coherent flash counts (one brightening,

‎tools/milk-analyzer/builtin_wave.py‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
from pathlib import Path
1212
import numpy as np
1313
from scene_equations import _scalar
14+
from quad_lines import PROFILE
15+
16+
17+
_CORE235_ENGINE = {
18+
'commit': 'e0b0a967f0ffd7d332106c366668ed271718472b',
19+
'patches_sha256': 'd73c955a26380a502516e6ba3a18baf753851244de4de2e5a3083930766a539a',
20+
}
1421

1522

1623
def _colour(source,main,frame,mode,alpha,width,height):
@@ -34,9 +41,20 @@ def _colour(source,main,frame,mode,alpha,width,height):
3441
return rgba.tolist()
3542

3643

37-
def source_builtin_wave(source,scene,audio,*,binary:Path,timeout_seconds=60):
44+
def source_builtin_wave(source,scene,audio,*,binary:Path,timeout_seconds=60,
45+
line_rendering_profile='canonical-gl-lines-v1'):
3846
if len(scene['frames'])!=len(audio['frames']):raise ValueError('wave/audio frame schedule mismatch')
3947
values=source['values'];width,height=scene['viewport']
48+
if line_rendering_profile not in {'canonical-gl-lines-v1',PROFILE}:
49+
raise ValueError('unknown builtin wave line rendering profile')
50+
dot=bool(_scalar(values,'bWaveDots',0,'bool'))
51+
scaled_dots=dot and line_rendering_profile==PROFILE
52+
if scaled_dots:
53+
engine=source.get('parser_inputs',{}).get('engine',{})
54+
if any(engine.get(key)!=value for key,value in _CORE235_ENGINE.items()):
55+
raise ValueError('GLES builtin dot engine identity mismatch')
56+
if width<=0 or height<=0 or width*height>1024*768 or height>1330:
57+
raise ValueError('GLES builtin dot profile requires viewport within reference area')
4058
mode=_scalar(values,'nWaveMode',0,'int')
4159
request_frames=[]
4260
for frame,data in zip(scene['frames'],audio['frames']):
@@ -56,8 +74,10 @@ def source_builtin_wave(source,scene,audio,*,binary:Path,timeout_seconds=60):
5674
native=json.loads(output.read_text())
5775
if native.get('render_context_time_bits')!=32:
5876
raise ValueError('prepared native waveform adapter with float32 render context required')
59-
dot=bool(_scalar(values,'bWaveDots',0,'bool'));thick=dot or bool(_scalar(values,'bWaveThick',0,'bool'))
60-
offsets=[[0,0],[1/width,0],[1/width,-1/height],[0,-1/height]] if thick else [[0,0]]
77+
thick=dot or bool(_scalar(values,'bWaveThick',0,'bool'))
78+
# Waveform::Draw uses one DotStyleFor(MainWave) point when quad mode is on.
79+
# At/below the reference area LineScale=1, hence size=2 and alphaScale=1.
80+
offsets=[[0,0]] if scaled_dots or not thick else [[0,0],[1/width,0],[1/width,-1/height],[0,-1/height]]
6181
result=[]
6282
for frame,data,geometry in zip(scene['frames'],audio['frames'],native['frames']):
6383
waves=[]
@@ -70,6 +90,7 @@ def source_builtin_wave(source,scene,audio,*,binary:Path,timeout_seconds=60):
7090
result.append({'positions':waves,'clip_positions':geometry['vertex_waves'],
7191
'rgba':_colour(source,frame['main'],data,native['mode'],geometry['wave_a_after_geometry'],width,height),
7292
'draw_mode':'points' if dot else 'loop' if geometry['closed_loop'] else 'strip',
93+
'point_size':2 if scaled_dots else 1,
7394
'additive':bool(_scalar(values,'bAdditiveWaves',0,'bool')),'copy_offsets':offsets})
7495
return {'basis':native['basis'],'mode':native['mode'],'frames':result,'source_hashes':native['source_hashes'],
7596
'adapter_sha256':native['adapter_sha256'],

0 commit comments

Comments
 (0)