3(arch) x 9(identity) x 3(rep) randomized full-factorial std79 DoE: 81/81 correct (FABRIC-3.md §XV)
Build / build-amd64-iso (push) Waiting to run
Build / build-aarch64-iso (push) Waiting to run
Build / build-riscv64-img (push) Waiting to run

Formal successor to §XII's ad hoc exerciser campaign, requested as a
genuine randomized full-factorial design matching this project's own
DoE methodology (capsules/doe.4th's Fisher-Yates shuffle), and written
entirely in FORTH per explicit request -- not host-orchestrated shell
scripting.

experiments/std79-doe/std79-doe.fth: builds a 27-cell (9 identity x 3
replicate) run matrix, Fisher-Yates shuffles it with a fixed seed
(matching doe.4th's own default), then dispatches each of the 24
exerciser test cases directly into the target identity's own live VM
via VM-EXEC -- no console USE redirection, no per-trial host
interaction. The zuse case runs as directly-compiled native code
(RUN-TEST-NATIVE) rather than VM-EXEC targeting "Hera" herself:
VM-EXEC's own vm_state_push/pop only saves rsp/exit_colon/ecw_nesting,
not input_buffer/input_pos, so a self-targeting call while this
capsule's own vm_interpret call is still mid-line would risk exactly
the class of bug the idle-tick reentrancy guards exist for.

amd64: all 27 trials ran with all 9 identities simultaneously live in
one boot -- clean, zero mismatches.

aarch64: hit a real, uninvestigated bug attaching all 9 simultaneously
-- the 6th live VM's birth stalled for 90+ minutes at 100%+ CPU with a
Stadium COOL-dispatch counter already at 335,000+ cycles, versus tens
of thousands at the same checkpoint for earlier identities. Not
root-caused here (flagged in FABRIC-3.md for later); worked around by
splitting into 3 boots of 3 simultaneously-live identities each, every
boot sharing the same seed so the master 27-slot shuffle is identical,
filtered per boot by a new ACTIVE-LO/ACTIVE-HI range
(EXEC-STD79-DOE's signature: seed lo hi -- ). run_id is always the
slot's true position in the master shuffle, so trial order stays
comparable across boots -- standard DoE blocking.

riscv64: same 3-boot pattern, clean.

Grand total: 81/81 trials correct, 0 mismatches, across all three
architectures, all nine identities, all three replicates.

Also flagged (FABRIC-3.md §XIV, not fixed): attaching several WIREBIND
identities near-simultaneously (whether via rapid hotplug or all
present from boot) causes the kernel to silently detect only some of
them -- confirmed at the host/QMP level that every device was genuinely
present. Worked around throughout this campaign by attaching one
identity at a time with confirmed waits; real hardware hotplug could
hit the same gap, so it's a genuine robustness concern, not just a
test-harness inconvenience.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXieurDfDSsDFdnSyusuWo
This commit is contained in:
Robert Allan James
2026-09-11 13:59:32 -04:00
co-authored by Claude Sonnet 5
parent 70db955ac9
commit e2abc56306
36 changed files with 158409 additions and 1 deletions
+177
View File
@@ -0,0 +1,177 @@
( std79-doe.4th - 3(arch, fixed per boot) x 9(identity) x 3(rep) )
( randomized full-factorial DoE. Same 24-case content as )
( std79-exerciser.fth, driven via VM-EXEC into each identity's own )
( live VM (all 9 pre-attached before this runs); "zuse" dispatches )
( into "Hera" herself since her power is a session flag on Hera, )
( not a separate registered VM. Fisher-Yates shuffle matches )
( doe.4th's own algorithm/style; seed fixed for cross-architecture )
( reproducibility (same permutation applied on every arch). )
9 CONSTANT N-ID
3 CONSTANT N-REPS
27 CONSTANT N-RUNS
24 CONSTANT N-TESTS
: ID-NAME ( idx -- c-addr u )
CASE
0 OF S" Hera" ENDOF
1 OF S" rajames" ENDOF
2 OF S" 00" ENDOF
3 OF S" 01" ENDOF
4 OF S" 02" ENDOF
5 OF S" 03" ENDOF
6 OF S" 04" ENDOF
7 OF S" 05" ENDOF
8 OF S" 06" ENDOF
ENDCASE ;
: ID-LABEL ( idx -- c-addr u )
CASE
0 OF S" zuse" ENDOF
1 OF S" rajames" ENDOF
2 OF S" 00" ENDOF
3 OF S" 01" ENDOF
4 OF S" 02" ENDOF
5 OF S" 03" ENDOF
6 OF S" 04" ENDOF
7 OF S" 05" ENDOF
8 OF S" 06" ENDOF
ENDCASE ;
( idx 0 (zuse) runs natively on Hera -- never via VM-EXEC targeting )
( "Hera" herself: VM-EXEC's own vm_state_push/pop only saves )
( rsp/exit_colon/ecw_nesting, not input_buffer/input_pos, so a )
( self-targeting call while THIS capsule's own vm_interpret call is )
( still mid-line would risk clobbering the outer parse -- the exact )
( class of bug the idle-tick reentrancy guards (repl.c) exist for, )
( just not covered by VM-EXEC's own narrower state stack. Sidestepped )
( entirely by never dispatching a string back into the caller's own )
( VM; the same 24 cases are just directly-compiled code below. )
: RUN-TEST-NATIVE ( n -- )
CASE
0 OF 7 3 /MOD SWAP . . ENDOF
1 OF -7 3 /MOD SWAP . . ENDOF
2 OF 7 -3 /MOD SWAP . . ENDOF
3 OF -7 -3 /MOD SWAP . . ENDOF
4 OF 2147483647 1 + . ENDOF
5 OF -2147483648 NEGATE . ENDOF
6 OF -2147483648 ABS . ENDOF
7 OF -1 1 RSHIFT . ENDOF
8 OF -8 2 RSHIFT . ENDOF
9 OF 1 31 LSHIFT . ENDOF
10 OF -1 0 < . ENDOF
11 OF -1 0 U< . ENDOF
12 OF 123 456 M* SWAP D. ENDOF
13 OF -123 456 M* SWAP D. ENDOF
14 OF 100000 S>D SWAP 7 M/MOD . . ENDOF
15 OF 7 11 3 */ . ENDOF
16 OF 7 11 3 */MOD SWAP . . ENDOF
17 OF -5 S>D SWAP D. ENDOF
18 OF -5 S>D 3 S>D D+ SWAP D. ENDOF
19 OF -5 S>D DNEGATE SWAP D. ENDOF
20 OF -5 3 MIN . -5 3 MAX . ENDOF
21 OF 5 0 10 WITHIN . ENDOF
22 OF -1 0 AND . -1 0 OR . 5 3 XOR . ENDOF
23 OF -2147483648 2/ . ENDOF
ENDCASE ;
: TEST-CMD ( n -- c-addr u )
CASE
0 OF S" 7 3 /MOD SWAP . ." ENDOF
1 OF S" -7 3 /MOD SWAP . ." ENDOF
2 OF S" 7 -3 /MOD SWAP . ." ENDOF
3 OF S" -7 -3 /MOD SWAP . ." ENDOF
4 OF S" 2147483647 1 + ." ENDOF
5 OF S" -2147483648 NEGATE ." ENDOF
6 OF S" -2147483648 ABS ." ENDOF
7 OF S" -1 1 RSHIFT ." ENDOF
8 OF S" -8 2 RSHIFT ." ENDOF
9 OF S" 1 31 LSHIFT ." ENDOF
10 OF S" -1 0 < ." ENDOF
11 OF S" -1 0 U< ." ENDOF
12 OF S" 123 456 M* SWAP D." ENDOF
13 OF S" -123 456 M* SWAP D." ENDOF
14 OF S" 100000 S>D SWAP 7 M/MOD . ." ENDOF
15 OF S" 7 11 3 */ ." ENDOF
16 OF S" 7 11 3 */MOD SWAP . ." ENDOF
17 OF S" -5 S>D SWAP D." ENDOF
18 OF S" -5 S>D 3 S>D D+ SWAP D." ENDOF
19 OF S" -5 S>D DNEGATE SWAP D." ENDOF
20 OF S" -5 3 MIN . -5 3 MAX ." ENDOF
21 OF S" 5 0 10 WITHIN ." ENDOF
22 OF S" -1 0 AND . -1 0 OR . 5 3 XOR ." ENDOF
23 OF S" -2147483648 2/ ." ENDOF
ENDCASE ;
CREATE RUN-MATRIX N-RUNS CELLS ALLOT
: MATRIX! ( val idx -- ) CELLS RUN-MATRIX + ! ;
: MATRIX@ ( idx -- val ) CELLS RUN-MATRIX + @ ;
VARIABLE SW-I VARIABLE SW-J VARIABLE SW-VI VARIABLE SW-VJ
: SWAP-MTX ( i j -- )
SW-J ! SW-I !
SW-I @ MATRIX@ SW-VI !
SW-J @ MATRIX@ SW-VJ !
SW-VJ @ SW-I @ MATRIX!
SW-VI @ SW-J @ MATRIX! ;
: INIT-MATRIX ( -- ) N-RUNS 0 DO I I MATRIX! LOOP ;
: SHUFFLE-MATRIX ( -- )
N-RUNS 1 - 0 DO
I N-RUNS 1 - RANDOM
I SWAP-MTX
LOOP ;
VARIABLE CURR-ID
VARIABLE CURR-REP
( Boot-batching support, added 2026-09-11 (FABRIC-3.md SXV): aarch64 hit a )
( severe, apparently superlinear per-tick slowdown once ~9-10 VMs stayed )
( simultaneously live at once (Stadium COOL dispatch cell counters running )
( into the hundreds of thousands with zero forward progress for 90+ )
( minutes) -- not yet root-caused, flagged as a real defect worth chasing )
( separately. Worked around by running each architecture as 3 boots of 3 )
( identities each (zuse+rajames+00, 01+02+03, 04+05+06), every boot sharing )
( the SAME seed so INIT-MATRIX/SHUFFLE-MATRIX produce the identical master )
( 27-slot permutation every time -- only ACTIVE-LO/ACTIVE-HI differ, so )
( each boot walks the FULL master order and simply skips any slot whose )
( identity isn't in its own live subset. The recorded run_id is always I )
( itself (the slot's true position in the master shuffle), never a )
( separately-incremented counter, so row order stays meaningful and )
( comparable across all 3 boots -- classic DoE "blocking": randomized )
( within, blocked across, by a practical constraint. )
VARIABLE ACTIVE-LO
VARIABLE ACTIVE-HI
: ACTIVE? ( idx -- flag )
DUP ACTIVE-LO @ >=
SWAP ACTIVE-HI @ <=
AND ;
: RUN-TEST ( n -- )
CURR-ID @ 0= IF
RUN-TEST-NATIVE
ELSE
TEST-CMD CURR-ID @ ID-NAME VM-EXEC
THEN ;
VARIABLE CURR-RUN-ID
: RUN-TRIAL ( id-idx rep run-id -- )
CURR-RUN-ID !
CURR-REP ! CURR-ID !
." DOE-RUN," CURR-RUN-ID @ . ." ," CURR-ID @ . ." ,"
CURR-ID @ ID-LABEL TYPE ." ," CURR-REP @ . CR
N-TESTS 0 DO I RUN-TEST LOOP ;
: EXEC-STD79-DOE ( seed lo hi -- )
ACTIVE-HI ! ACTIVE-LO !
SEED
INIT-MATRIX SHUFFLE-MATRIX
." DOE-HEADER,run_id,id_idx,id_label,rep" CR
N-RUNS 0 DO
I MATRIX@
DUP N-REPS /
DUP ACTIVE? IF
SWAP N-REPS MOD I RUN-TRIAL
ELSE
DROP DROP
THEN
LOOP
." STD79-DOE: complete" CR ;