Fix SWAP-MTX: Fisher-Yates shuffle was never actually shuffling correctly

Found while building the analysis report for the ACL-RWT relaunch
campaign: cfg=0 was missing from run coverage for 2 of 3 seeds, reproduced
identically across all three architectures. Root-caused rather than
worked around, per Captain Bob's "this is worrisome."

SWAP-MTX (capsules/doe.4th Block 2104) never actually swapped two
RUN-MATRIX cells -- it performed a lossy one-way copy (second MATRIX!
call mis-targeted mat[i] again instead of mat[j]). Confirmed by direct
empirical test on the hosted build: INIT-MATRIX gives mat[0]=0, mat[5]=5;
after 0 5 SWAP-MTX, mat[0]=0 (unchanged, should be 5) and mat[5]=0
(correct), with the original value 5 permanently destroyed. Every
Fisher-Yates shuffle this mechanism has ever run silently duplicated some
values and dropped others -- not a true permutation. Not new, not
introduced by item 4.6/Stadium work; predates this session.

Fixed with explicit temp variables (SW-I/SW-J/SW-VI/SW-VJ), trivially
verifiable by inspection over clever stack juggling. Verified on the
hosted build for all three seeds used by the relaunch campaign: each now
produces all 16 cfg values exactly 30 times, run_id 0-479 fully distinct.
Three-arch QEMU acceptance clean: 1012/0/0 POST on all three, identical
dict_hash (expected -- doe.4th isn't C-registered or auto-loaded at
boot). BLOCK_MAP.md correctly shows only doe.4th's own hash changed.

Also includes the R analysis/chart pipeline (analyse_stadium_relaunch.R)
built for the relaunch campaign report, and the three acceptance boot
logs.

Retroactive caveat: the relaunch campaign's own run-matrix coverage
(experiments/bare_metal/runs/acl-rwt-20260820/) is not a valid uniform
permutation, having run against the buggy shuffle. Whether to re-run it
against the fix is a separate call, not made here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-20 10:56:12 -04:00
co-authored by Claude Sonnet 5
parent 79d160c1ca
commit 7e2fd9f044
23 changed files with 44760 additions and 13 deletions
@@ -0,0 +1,94 @@
<?xml version='1.0' encoding='UTF-8' ?>
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='648.00pt' height='432.00pt' viewBox='0 0 648.00 432.00'>
<g class='svglite'>
<defs>
<style type='text/css'><![CDATA[
.svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
fill: none;
stroke: #000000;
stroke-linecap: round;
stroke-linejoin: round;
stroke-miterlimit: 10.00;
}
.svglite text {
white-space: pre;
}
.svglite g.glyphgroup path {
fill: inherit;
stroke: none;
}
]]></style>
</defs>
<rect width='100%' height='100%' style='stroke: none; fill: #FFFFFF;'/>
<defs>
<clipPath id='cpMC4wMHw2NDguMDB8MC4wMHw0MzIuMDA='>
<rect x='0.00' y='0.00' width='648.00' height='432.00' />
</clipPath>
</defs>
<g clip-path='url(#cpMC4wMHw2NDguMDB8MC4wMHw0MzIuMDA=)'>
<rect x='0.00' y='0.000000000000057' width='648.00' height='432.00' style='stroke-width: 1.07; stroke: none; fill: #0D0D0D;' />
</g>
<defs>
<clipPath id='cpNjIuNzh8NjQyLjUyfDI0LjI5fDM0Ny43Mw=='>
<rect x='62.78' y='24.29' width='579.74' height='323.44' />
</clipPath>
</defs>
<g clip-path='url(#cpNjIuNzh8NjQyLjUyfDI0LjI5fDM0Ny43Mw==)'>
<rect x='62.78' y='24.29' width='579.74' height='323.44' style='stroke-width: 1.07; stroke: none; fill: #0D0D0D;' />
<polyline points='62.78,287.08 642.52,287.08 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<polyline points='62.78,186.01 642.52,186.01 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<polyline points='62.78,84.93 642.52,84.93 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<polyline points='171.48,347.73 171.48,24.29 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<polyline points='352.65,347.73 352.65,24.29 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<polyline points='533.82,347.73 533.82,24.29 ' style='stroke-width: 1.07; stroke: #1E1E1E; stroke-linecap: butt;' />
<rect x='80.90' y='135.47' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='443.24' y='135.47' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='262.07' y='135.47' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='80.90' y='236.55' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='443.24' y='236.55' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='262.07' y='236.55' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='80.90' y='34.39' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='443.24' y='34.39' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='262.07' y='34.39' width='181.17' height='101.08' style='stroke-width: 3.20; stroke: #0D0D0D; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<text x='171.48' y='190.12' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='533.82' y='190.12' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='352.65' y='190.12' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='171.48' y='291.19' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='533.82' y='291.19' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='352.65' y='291.19' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='171.48' y='89.04' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='533.82' y='89.04' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='352.65' y='89.04' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
</g>
<g clip-path='url(#cpMC4wMHw2NDguMDB8MC4wMHw0MzIuMDA=)'>
<text x='57.85' y='290.87' text-anchor='end' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='33.66px' lengthAdjust='spacingAndGlyphs'>amd64</text>
<text x='57.85' y='189.79' text-anchor='end' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='39.78px' lengthAdjust='spacingAndGlyphs'>aarch64</text>
<text x='57.85' y='88.72' text-anchor='end' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='34.84px' lengthAdjust='spacingAndGlyphs'>riscv64</text>
<text x='171.48' y='360.23' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='30.62px' lengthAdjust='spacingAndGlyphs'>12345</text>
<text x='352.65' y='360.23' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='30.62px' lengthAdjust='spacingAndGlyphs'>67890</text>
<text x='533.82' y='360.23' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='30.62px' lengthAdjust='spacingAndGlyphs'>13579</text>
<text x='352.65' y='372.82' text-anchor='middle' style='font-size: 11.00px;fill: #CCCCCC; font-family: "Liberation Sans";' textLength='25.72px' lengthAdjust='spacingAndGlyphs'>Seed</text>
<text transform='translate(13.05,186.01) rotate(-90)' text-anchor='middle' style='font-size: 11.00px;fill: #CCCCCC; font-family: "Liberation Sans";' textLength='58.72px' lengthAdjust='spacingAndGlyphs'>Architecture</text>
<rect x='272.30' y='386.06' width='160.71' height='40.46' style='stroke-width: 1.07; stroke: none; fill: #0D0D0D;' />
<text x='277.78' y='410.07' style='font-size: 11.00px;fill: #CCCCCC; font-family: "Liberation Sans";' textLength='73.41px' lengthAdjust='spacingAndGlyphs'>Rows captured</text>
<image width='70.87' height='14.17' x='356.66' y='391.54' preserveAspectRatio='none' xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAABCAYAAABkOJMpAAAAfklEQVQ4ja2OURKAIAhEn+fpBN2+k0kfWZMIiE0fzizuW9hy7JtQQABKe4A4WrOP1p61Q3teJsOtZKI7AZ/l3F6zPY5eYbtcpofXX+nlWz9xQsJ794x6J9lpr9ncdqZYNYee0f/yS8eP/piP+C+zYN+z/G42/qqRqbf34itwAsyhkfmCoyqHAAAAAElFTkSuQmCC'/>
<polyline points='356.78,402.88 356.78,405.71 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='371.49,402.88 371.49,405.71 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='386.21,402.88 386.21,405.71 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='400.92,402.88 400.92,405.71 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='415.64,402.88 415.64,405.71 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='356.78,394.37 356.78,391.54 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='371.49,394.37 371.49,391.54 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='386.21,394.37 386.21,391.54 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='400.92,394.37 400.92,391.54 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='415.64,394.37 415.64,391.54 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<text x='356.78' y='418.76' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='6.12px' lengthAdjust='spacingAndGlyphs'>0</text>
<text x='371.49' y='418.76' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='18.38px' lengthAdjust='spacingAndGlyphs'>100</text>
<text x='386.21' y='418.76' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='18.38px' lengthAdjust='spacingAndGlyphs'>200</text>
<text x='400.92' y='418.76' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='18.38px' lengthAdjust='spacingAndGlyphs'>300</text>
<text x='415.64' y='418.76' text-anchor='middle' style='font-size: 11.00px;fill: #AAAAAA; font-family: "Liberation Sans";' textLength='18.38px' lengthAdjust='spacingAndGlyphs'>400</text>
<text x='352.65' y='23.35' text-anchor='middle' style='font-size: 9.00px;fill: #666666; font-family: "Liberation Sans";' textLength='329.50px' lengthAdjust='spacingAndGlyphs'>3x3 Latin square: 3 seeds x 3 ISAs, 30 reps x 16 L8 configs per cell (480 rows/cell)</text>
<text x='352.65' y='14.98' text-anchor='middle' style='font-size: 12.00px; font-weight: bold;fill: #FFFFFF; font-family: "Liberation Sans";' textLength='334.00px' lengthAdjust='spacingAndGlyphs'>EXEC-DOE Campaign Completeness — Stadium Substrate</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB