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,92 @@
<?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: #FFFFFF;' />
</g>
<defs>
<clipPath id='cpNTQuNzh8NjQyLjUyfDI0LjI5fDM1MS42Ng=='>
<rect x='54.78' y='24.29' width='587.74' height='327.38' />
</clipPath>
</defs>
<g clip-path='url(#cpNTQuNzh8NjQyLjUyfDI0LjI5fDM1MS42Ng==)'>
<polyline points='54.78,290.28 642.52,290.28 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<polyline points='54.78,187.97 642.52,187.97 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<polyline points='54.78,85.67 642.52,85.67 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<polyline points='164.98,351.66 164.98,24.29 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<polyline points='348.65,351.66 348.65,24.29 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<polyline points='532.32,351.66 532.32,24.29 ' style='stroke-width: 1.07; stroke: #E5E5E5; stroke-linecap: butt;' />
<rect x='73.15' y='136.82' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='440.49' y='136.82' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='256.82' y='136.82' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='73.15' y='239.13' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='440.49' y='239.13' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='256.82' y='239.13' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='73.15' y='34.52' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='440.49' y='34.52' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<rect x='256.82' y='34.52' width='183.67' height='102.30' style='stroke-width: 3.20; stroke: #FFFFFF; stroke-linecap: butt; stroke-linejoin: miter; fill: #2CA02C;' />
<text x='164.98' y='192.08' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='532.32' y='192.08' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='348.65' y='192.08' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='164.98' y='294.39' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='532.32' y='294.39' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='348.65' y='294.39' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='164.98' y='89.78' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='532.32' y='89.78' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
<text x='348.65' y='89.78' text-anchor='middle' style='font-size: 11.95px; font-weight: bold;fill: #1A1A1A; font-family: "Liberation Sans";' textLength='43.16px' lengthAdjust='spacingAndGlyphs'>480/480</text>
</g>
<g clip-path='url(#cpMC4wMHw2NDguMDB8MC4wMHw0MzIuMDA=)'>
<text x='49.85' y='293.31' text-anchor='end' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='26.89px' lengthAdjust='spacingAndGlyphs'>amd64</text>
<text x='49.85' y='191.00' text-anchor='end' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='31.78px' lengthAdjust='spacingAndGlyphs'>aarch64</text>
<text x='49.85' y='88.70' text-anchor='end' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='27.88px' lengthAdjust='spacingAndGlyphs'>riscv64</text>
<text x='164.98' y='362.65' text-anchor='middle' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='24.45px' lengthAdjust='spacingAndGlyphs'>12345</text>
<text x='348.65' y='362.65' text-anchor='middle' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='24.45px' lengthAdjust='spacingAndGlyphs'>67890</text>
<text x='532.32' y='362.65' text-anchor='middle' style='font-size: 8.80px;fill: #4D4D4D; font-family: "Liberation Sans";' textLength='24.45px' lengthAdjust='spacingAndGlyphs'>13579</text>
<text x='348.65' y='374.78' text-anchor='middle' style='font-size: 11.00px; font-family: "Liberation Sans";' textLength='25.72px' lengthAdjust='spacingAndGlyphs'>Seed</text>
<text transform='translate(13.05,187.97) rotate(-90)' text-anchor='middle' style='font-size: 11.00px; font-family: "Liberation Sans";' textLength='58.72px' lengthAdjust='spacingAndGlyphs'>Architecture</text>
<text x='273.78' y='411.06' style='font-size: 11.00px; font-family: "Liberation Sans";' textLength='73.41px' lengthAdjust='spacingAndGlyphs'>Rows captured</text>
<image width='70.87' height='14.17' x='352.66' y='393.50' preserveAspectRatio='none' xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAABCAYAAABkOJMpAAAAfklEQVQ4ja2OURKAIAhEn+fpBN2+k0kfWZMIiE0fzizuW9hy7JtQQABKe4A4WrOP1p61Q3teJsOtZKI7AZ/l3F6zPY5eYbtcpofXX+nlWz9xQsJ794x6J9lpr9ncdqZYNYee0f/yS8eP/piP+C+zYN+z/G42/qqRqbf34itwAsyhkfmCoyqHAAAAAElFTkSuQmCC'/>
<polyline points='352.78,404.84 352.78,407.68 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='367.49,404.84 367.49,407.68 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='382.21,404.84 382.21,407.68 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='396.92,404.84 396.92,407.68 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='411.64,404.84 411.64,407.68 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='352.78,396.34 352.78,393.50 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='367.49,396.34 367.49,393.50 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='382.21,396.34 382.21,393.50 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='396.92,396.34 396.92,393.50 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<polyline points='411.64,396.34 411.64,393.50 ' style='stroke-width: 0.38; stroke: #FFFFFF; stroke-linecap: butt;' />
<text x='352.78' y='419.21' text-anchor='middle' style='font-size: 8.80px; font-family: "Liberation Sans";' textLength='4.89px' lengthAdjust='spacingAndGlyphs'>0</text>
<text x='367.49' y='419.21' text-anchor='middle' style='font-size: 8.80px; font-family: "Liberation Sans";' textLength='14.67px' lengthAdjust='spacingAndGlyphs'>100</text>
<text x='382.21' y='419.21' text-anchor='middle' style='font-size: 8.80px; font-family: "Liberation Sans";' textLength='14.67px' lengthAdjust='spacingAndGlyphs'>200</text>
<text x='396.92' y='419.21' text-anchor='middle' style='font-size: 8.80px; font-family: "Liberation Sans";' textLength='14.67px' lengthAdjust='spacingAndGlyphs'>300</text>
<text x='411.64' y='419.21' text-anchor='middle' style='font-size: 8.80px; font-family: "Liberation Sans";' textLength='14.67px' lengthAdjust='spacingAndGlyphs'>400</text>
<text x='348.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='348.65' y='14.98' text-anchor='middle' style='font-size: 12.00px; font-weight: bold; font-family: "Liberation Sans";' textLength='334.00px' lengthAdjust='spacingAndGlyphs'>EXEC-DOE Campaign Completeness — Stadium Substrate</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.8 KiB