Files
StarPilot/roadscore/experiments/composition_20260916/review.py
T
firestar5683 0766138ca2 RoadScore
2026-09-19 00:22:33 -05:00

39 lines
9.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""One local-only listening gate; no autoplay, uploads or external dependencies."""
from pathlib import Path
import json,html
from backends import inventory,measurements
O=Path(__file__).resolve().parents[2]/'results/composition_20260916'
def audio(path):return f'<audio controls preload="none" src="{path}"></audio>'
def esc(x):return html.escape(str(x))
p=['''<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>RoadScore · Composition listening gate</title><style>body{font:17px/1.5 system-ui;background:#11131b;color:#eee;max-width:1080px;margin:40px auto;padding:0 24px}a{color:#95d9ef}h1,h2{line-height:1.2}h2{margin-top:48px}p{max-width:850px;color:#bdc7d5}table{border-collapse:collapse;width:100%}td,th{padding:12px 8px;text-align:left;border-bottom:1px solid #333;vertical-align:top}audio{max-width:100%;width:320px}video{width:100%}.note{border-left:4px solid #d6ab66;padding:12px 20px;background:#20222c}pre{white-space:pre-wrap;font-size:12px}nav{display:flex;gap:20px;flex-wrap:wrap}</style><h1>RoadScore · Composition listening gate</h1><p>September 16 · Private local research · New strategy after human rejection of the previous section-bank approach.</p><div class="note">No musical winner has been selected. Section names describe requests, not verified musical form. All development output was physically muted. Playback requires a deliberate click; do not play this page while the household mute restriction is still in effect.</div><nav>''']
for i,title in [('a','SA3'),('b','Alternatives'),('c','A/B'),('d','Transitions'),('e','Gestures'),('f','Road'),('g','Arrival'),('h','Performance')]:p.append(f'<a href="#{i}">{title}</a>')
p.append('</nav><h2 id="a">A. One stronger SA3 control</h2><p>Fresh Chestnut-generated identity; explicitly instrumental K-pop/game-score production. Extreme roles use the same source prefix, without an end anchor. Prompt target:128 BPM,D minor. Neither tempo nor key is guaranteed. Judge role contrast, rhythmic coherence and recurring identity.</p>'+audio('sa3/identity.wav'))
p.append('<h2 id="b">B. Alternative composition models</h2><p>ACE-Step1.5 ran locally on the M1 Max using its official MLX support. Listen to the entire90-second piece for actual development, not just attractive timbre. Separate roles reference that piece; this is style conditioning rather than proven exact continuation.</p>'+audio('ace/structured90.wav'))
y=O/'yue/benchmark.json'
if y.exists():
d=json.loads(y.read_text());p.append('<h3>YuE2 · symbolic composition experiment</h3>')
if (O/'yue/structured90/audio.flac').exists():p.append(audio('yue/structured90/audio.flac'))
p.append('<p>'+esc('Bounded generation. Truncation: '+str(d.get('truncated'))+'; success: '+str(d.get('success')))+'. Audio audit found37.7s near silence, mostly late; the generated plan choseF minor despite theD-minor request. Instrumental adherence and section hierarchy require listening.</p><a href="yue/benchmark.json">Measurement and limitations</a>')
p.append('<p>Cheap screens also considered MAGNeT (short masked-token clips, no documented full-song form interface) and LeVo2/SongGeneration (official source unavailable during this attempt). No further candidates or accelerator ports were attempted.</p>')
p.append('<h2 id="c">C. Same-target model comparison</h2><p>Ignore the labels on a first listen if possible. Can you identify a restrained verse, rising prechorus, largest chorus, contrasting bridge and intentional ending? Are they recognizably one song? Levels are the native generated outputs; no claim of loudness-matched preference testing.</p><table><tr><th>Requested role</th><th>SA3 · Chestnut</th><th>ACE-Step · Mac</th></tr>')
for role in ['verse','prechorus','chorus','bridge','outro']:p.append(f'<tr><td>{role.title()}</td><td>{audio("sa3/"+role+".wav")}</td><td>{audio("ace/"+role+".wav")}</td></tr>')
p.append('</table><h2 id="d">D. Generate the transition itself</h2><p>These SA3 windows retain about4.09s of preceding audio context before generating the transition. They are not independent section files glued together. Judge whether tempo, groove and motif survive while the arrangement changes.</p>')
for role in ['verse_to_chorus','chorus_to_bridge','song_to_outro']:p.append('<h3>'+role.replace('_',' ').title()+'</h3>'+audio('sa3/'+role+'_with_context.wav'))
p.append('<h3>ACE-Step · verse through chorus</h3><p>40s generation with structural tags and the same90s reference.</p>'+audio('ace/verse_to_chorus.wav'))
p.append('<h2 id="e">E. Immediate musical gestures</h2><p>Same source-derived drum family, estimated tempo/phase, finite fills, no new guessed harmonic pitches. Synthetic explanatory timeline: signal2–6s; curve predicted8s for14s; navigation18s; arrival preparation24s. This is separate from the real-route tests below.</p><table><tr><th>Unaltered source</th><th>With gestures</th></tr><tr><td>'+audio('gestures/dry.wav')+'</td><td>'+audio('gestures/with_gestures.wav')+'</td></tr></table><p>Signal response115ms; zero sample scheduling lateness in this synthetic test. Beat estimates are not human-verified downbeats. <a href="gestures/evidence.json">Sample timing evidence</a>.</p><details><summary>Individual gesture family</summary>')
for role in ['turn_signal','curve_prepare','curve_apex','navigation_turn','lane_change','stop','resume','arrival_prepare','arrival']:p.append('<p>'+role.replace('_',' ')+'</p>'+audio('gestures/'+role+'.wav'))
p.append('</details><h2 id="f">F. Real road replay</h2>')
if (O/'regressions.json').exists():
d=json.loads((O/'regressions.json').read_text());p.append('<table><tr><th>Run</th><th>Audio</th><th>Fresh jobs</th><th>Source repeats / underflows</th></tr>')
for row in d['native']+[d['mac_full']]:p.append(f'<tr><td>{esc(row["run"])}</td><td>{row["audio_seconds"]:.1f}s</td><td>{row["fresh_jobs"]}</td><td>{row["fallbacks"]} / {row["renderer_underflows"]}</td></tr>')
p.append('</table><p>Full Mac route:571.6s, zero host starvation, output flags or late samples; maximum measured alignment0.324ms. Native arrival and curve also passed without recording. Fresh video-recording attempts failed timing checks on both hosts; preserved in the evidence. Review footage below is separate stored-score replay of the exact fresh score, without invoking Chestnut. Stored Mac samples verified identical, with0.583ms maximum clock error; native stored replay9.90ms. UI frame gaps reached149ms. Existing UI alerts and screen transitions remain visible.</p><details><summary>Replay measurements and preserved capture failures</summary><pre>'+esc(json.dumps(d,indent=2))+'</pre></details>')
for file in ['road_synchronized.mp4','arrival_synchronized.mp4']:
if (O/file).exists():p.append(f'<video controls preload="none" poster="road_poster.png" src="{file}"></video>')
p.append('<p>Fresh generation consumes only delivered cereal snapshots. Curves use the current model forecast; long-horizon navigation selects later generative prompts. Short-horizon fills do not pretend to generate a new chorus in six seconds. Overlay form labels show intent, not a proven section classifier.</p><h2 id="g">G. Outro → cadence → silence</h2><p>Actual native arrival capture, beginning at audio195s. First outro-conditioned material203.964s; final cadence trigger239.2s. That provides35.236s of generated concluding material before the cadence. Whether it actually sounds concluding is the listening gate. An original accounting bug erased the counter when navigation cleared; the original archive and correction audit are preserved.</p>'+audio('arrival_excerpt.wav')+'<p><a href="arrival_audit.json">Arrival evidence</a></p><h3>Second route · corrected live outro evidence</h3><p>The full community-route run recorded21.65s of outro-conditioned playback before cadence. This separate excerpt starts at audio515s. Both musical endings remain pending listening.</p>'+audio('arrival_mac_excerpt.wav')+'')
p.append('<h2 id="h">H. Measured performance</h2><p>RTF = generation wall time / playable audio duration. Lower than1 keeps up with playback. SA3 rows exclude already resident worker startup; ACE initialization248.4s included downloads and is not a comparable cold-start benchmark. Memory is process peak RSS; Chestnut tracking is sampled allocation, not verified peak VRAM. Mac unified memory can exceed RSS; ACE caused substantial swap pressure.</p><table><tr><th>Backend / output</th><th>Audio</th><th>Wall</th><th>RTF</th><th>Host peak</th></tr>')
for d in measurements(O):
duration=d.get('duration',d.get('playable_new_seconds'));wall=d.get('seconds',d.get('generation_seconds'));rtf=wall/duration if duration and wall else None
if duration and wall:p.append(f'<tr><td>{esc(d["backend"]+" / "+d["sample"])}</td><td>{duration:.2f}s</td><td>{wall:.2f}s</td><td>{rtf:.2f}</td><td>{d.get("host_peak_mib",0):.0f}MiB</td></tr>')
p.append('</table><details><summary>Backend boundaries and exact measurements</summary><pre>'+esc(json.dumps({'backends':inventory(),'measurements':measurements(O)},indent=2))+'</pre></details><p>Source and architecture findings: <a href="../../COMPOSITION.md">COMPOSITION.md</a>. Latest status: <a href="../../STATUS.md">STATUS.md</a>.</p>')
(O/'index.html').write_text(''.join(p));(O/'backends.json').write_text(json.dumps(inventory(),indent=2));print(O/'index.html')