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
+10 -10
View File
@@ -1,5 +1,5 @@
# Capsule Block Manifest — Auto-generated
<!-- Generated by mkcapsule --manifest 2026-08-19T11:54:28Z -->
<!-- Generated by mkcapsule --manifest 2026-08-20T14:53:07Z -->
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
<!-- Hand-written justifications and immutability notes live -->
<!-- in MANIFEST.md alongside this auto-generated index. -->
@@ -12,7 +12,7 @@
| `artemis:init.4th` | 4110, 4111, 4112, 4113, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4177, 4178, 4179, 4180, 4181, 4182, 4851, 4852 | `0x1859f0148048a2c1` |
| `common:msg.4th` | 4055 | `0xa99c5bcd3877f80e` |
| `doe-campaign.4th` | 4060, 4061, 4062, 4063, 4064, 4065 | `0x3d4549142d91ec20` |
| `doe.4th` | 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107 | `0xb6ecf5374e8ee77c` |
| `doe.4th` | 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107 | `0xf154616d248e861f` |
| `fabric.4th` | 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 5000, 5001, 5002 | `0x9b1d061339cea98d` |
| `font.4th` | 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985 | `0x720792b4fc758156` |
| `hermes:init.4th` | 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4175, 4176 | `0x85c7b311d1e5bf97` |
@@ -79,14 +79,14 @@
| 2093 | `init-6.4th` | `0x06fc0ce1e369ef5a` | ok |
| 2094 | `init-6.4th` | `0x06fc0ce1e369ef5a` | ok |
| 2095 | `init-6.4th` | `0x06fc0ce1e369ef5a` | ok |
| 2100 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2101 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2102 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2103 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2104 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2105 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2106 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2107 | `doe.4th` | `0xb6ecf5374e8ee77c` | ok |
| 2100 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2101 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2102 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2103 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2104 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2105 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2106 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2107 | `doe.4th` | `0xf154616d248e861f` | ok |
| 2130 | `init-4.4th` | `0x89e3ef1db5ac0627` | ok |
| 2131 | `init-4.4th` | `0x89e3ef1db5ac0627` | ok |
| 2132 | `init-4.4th` | `0x89e3ef1db5ac0627` | ok |