item 4.6: fix Stadium quota-grant ordering; fix aarch64 PSCI SYSTEM_RESET function ID
Artemis's 30-rep surface stress campaign was failing 100% of trials on all three architectures: stadium_grant_quota() ran after IDENTITY exec in capsule_birth.c, but Artemis's init.4th auto-runs the stress campaign as part of that same IDENTITY exec, so every STADIUM-ADMIT call during it hit a nonexistent quota slot and refused unconditionally. Moved the grant call before IDENTITY exec. Verified 30/30 reps PASS on amd64, aarch64, and riscv64 post-fix (was 30/30 FAIL on all three pre-fix). Also fixed an independent, real bug found during the same acceptance pass: aarch64's arch_cold_reset() issued PSCI SYSTEM_RESET using the SMC64 calling convention (0xC4000009), which is not a valid PSCI function ID -- SYSTEM_RESET has no SMC64 variant. Corrected to the SMC32 encoding (0x84000009). This did not resolve the separate aarch64 BYE cold-restart exception also found in this pass (root cause not yet found, tested and refuted an interrupt-race hypothesis, documented in FABRIC-2.md Section I for follow-up) but is a genuine spec fix worth keeping regardless. Full writeup, evidence, and the still-open aarch64 crash investigation in FABRIC-2.md Sections H and I. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
48ab9945de
commit
8d90538801
+83
-23
@@ -9,6 +9,13 @@ Block 4110
|
||||
3076 CONSTANT ART-DATA-LBN
|
||||
22998 CONSTANT ART-DATA-BLKS
|
||||
65208 CONSTANT Q-DECAY
|
||||
Block 4178
|
||||
( item 4.6 -- StadiumBehaviour tags, match stadium.h. )
|
||||
0 CONSTANT SB-MIGRATE
|
||||
1 CONSTANT SB-DELIVER
|
||||
2 CONSTANT SB-EXPIRE
|
||||
3 CONSTANT SB-COOL
|
||||
-1 CONSTANT STADIUM-NONE
|
||||
Block 4111
|
||||
( Arch-neutral little-endian byte I/O -- 32-bit )
|
||||
: LE32! ( u addr -- )
|
||||
@@ -55,13 +62,38 @@ Block 4113
|
||||
: FM-CLR ( n -- )
|
||||
FM-ADDR-BIT DUP C@ ROT BIT-CLR SWAP C! UPDATE ;
|
||||
Block 4137
|
||||
( Block heat arena -- Q48.16 heat per data block slot )
|
||||
CREATE BLK-HEAT ART-DATA-BLKS CELLS ALLOT
|
||||
( item 4.6 -- Stadium cell-index arena, not a heat arena. One )
|
||||
( slot per possible LBN, holding STADIUM-NONE or a live cell )
|
||||
( index -- residency exists only while a block is allocated )
|
||||
( (admission-on-allocate, FABRIC-2.md item 4.6's ruling). )
|
||||
CREATE BLK-CELL ART-DATA-BLKS CELLS ALLOT
|
||||
Block 4138
|
||||
( Block heat accessors and LBN conversion )
|
||||
: BLK-HEAT@ ( n -- q48 ) CELLS BLK-HEAT + @ ;
|
||||
: BLK-HEAT! ( q48 n -- ) CELLS BLK-HEAT + ! ;
|
||||
( Cell-index accessors and LBN conversion. Heat itself now )
|
||||
( lives on the Stadium -- see BLK-ADMIT/STADIUM-HEAT@/! below. )
|
||||
: BLK-CELL@ ( n -- cell ) CELLS BLK-CELL + @ ;
|
||||
: BLK-CELL! ( cell n -- ) CELLS BLK-CELL + ! ;
|
||||
: LBN>IDX ( lbn -- n ) ART-DATA-LBN - ;
|
||||
Block 4177
|
||||
( item 4.6 -- Stadium admission for index n; see 4179. )
|
||||
VARIABLE BLK-ADMIT-IDX
|
||||
: BLK-ADMIT ( n -- flag )
|
||||
BLK-ADMIT-IDX !
|
||||
Q.1 STADIUM-RES-PULL
|
||||
BLK-ADMIT-IDX @ SWAP DUP >R
|
||||
SB-COOL STADIUM-ADMIT
|
||||
DUP STADIUM-NONE = IF
|
||||
DROP R> STADIUM-RES-PUSH FALSE EXIT
|
||||
THEN
|
||||
R> DROP
|
||||
BLK-ADMIT-IDX @ BLK-CELL!
|
||||
BLK-ADMIT-IDX @ FM-SET
|
||||
TRUE ;
|
||||
Block 4179
|
||||
( item 4.6 -- init BLK-CELL[] all-free (STADIUM-NONE). )
|
||||
: BLK-CELL-INIT-FREE ( -- )
|
||||
ART-DATA-BLKS 0 DO
|
||||
STADIUM-NONE I BLK-CELL!
|
||||
LOOP ;
|
||||
Block 4122
|
||||
( Block allocator -- first-free linear scan )
|
||||
( NOTE: Hermes owns 4100-9,4114-21,4142+. Artemis resumes 4122 )
|
||||
@@ -71,13 +103,18 @@ Block 4122
|
||||
LOOP -1 ;
|
||||
: BLK-ALLOC ( -- lbn|-1 )
|
||||
FM-FIND-FREE DUP -1 = IF EXIT THEN
|
||||
DUP FM-SET Q.1 OVER BLK-HEAT! ART-DATA-LBN + ;
|
||||
DUP BLK-ADMIT 0= IF DROP -1 EXIT THEN
|
||||
ART-DATA-LBN + ;
|
||||
Block 4180
|
||||
( item 4.6 -- BLK-FREE evicts the Stadium cell too. )
|
||||
: BLK-FREE ( lbn -- )
|
||||
ART-DATA-LBN -
|
||||
DUP 0 < IF DROP EXIT THEN
|
||||
DUP ART-DATA-BLKS >= IF DROP EXIT THEN
|
||||
DUP FM-TEST 0= IF DROP EXIT THEN
|
||||
DUP FM-CLR 0 SWAP BLK-HEAT! ;
|
||||
DUP FM-CLR
|
||||
DUP BLK-CELL@ STADIUM-EVICT DROP
|
||||
STADIUM-NONE SWAP BLK-CELL! ;
|
||||
Block 4123
|
||||
( Artemis magic and blank detection )
|
||||
( Magic = "ARTEMIS\0" = 41 52 54 45 4D 49 53 00 )
|
||||
@@ -122,7 +159,7 @@ Block 4124
|
||||
DROP ART-UNRECOG-DISK ;
|
||||
: BLK-FETCH ( lbn -- addr )
|
||||
DUP ART-DATA-LBN >= IF
|
||||
DUP LBN>IDX Q.1 SWAP BLK-HEAT! THEN
|
||||
DUP LBN>IDX BLK-CELL@ Q.1 SWAP STADIUM-HEAT! THEN
|
||||
BLOCK ;
|
||||
: BLK-PERSIST ( lbn -- ) BLOCK DROP UPDATE ;
|
||||
: ART-FLUSH ( -- ) FLUSH ;
|
||||
@@ -159,7 +196,7 @@ Block 4131
|
||||
( ART-INIT -- boot state machine )
|
||||
VARIABLE ART-BOOT-MODE
|
||||
: ART-INIT ( -- )
|
||||
BLK-HEAT ART-DATA-BLKS CELLS 0 FILL
|
||||
BLK-CELL-INIT-FREE
|
||||
ART-BOOT-DETECT DUP ART-BOOT-MODE !
|
||||
CASE
|
||||
ART-BLANK-DISK OF ART-FORMAT ENDOF
|
||||
@@ -167,21 +204,31 @@ VARIABLE ART-BOOT-MODE
|
||||
ART-UNRECOG-DISK OF ART-HALT-UNRECOG ENDOF
|
||||
ENDCASE ;
|
||||
Block 4139
|
||||
( Fleet K total and block cooling )
|
||||
( item 4.6 -- K total, skips non-resident (STADIUM-NONE). )
|
||||
: ART-K-TOTAL ( -- q48 )
|
||||
0 ART-DATA-BLKS 0 DO I BLK-HEAT@ + LOOP ;
|
||||
0 ART-DATA-BLKS 0 DO
|
||||
I BLK-CELL@ DUP STADIUM-NONE <> IF
|
||||
STADIUM-HEAT@ +
|
||||
ELSE
|
||||
DROP
|
||||
THEN
|
||||
LOOP ;
|
||||
Block 4181
|
||||
( item 4.6 -- cooling, routed via Stadium residency. )
|
||||
: ART-COOL ( -- )
|
||||
ART-DATA-BLKS 0 DO
|
||||
I BLK-HEAT@ DUP 0 > IF
|
||||
Q-DECAY Q.* I BLK-HEAT!
|
||||
ELSE DROP THEN
|
||||
I BLK-CELL@ DUP STADIUM-NONE <> IF
|
||||
DUP STADIUM-HEAT@ Q-DECAY Q.* SWAP STADIUM-HEAT!
|
||||
ELSE
|
||||
DROP
|
||||
THEN
|
||||
LOOP ;
|
||||
Block 4140
|
||||
( Block reap and compudynamic tick )
|
||||
: ART-REAP ( -- )
|
||||
ART-DATA-BLKS 0 DO
|
||||
I FM-TEST IF
|
||||
I BLK-HEAT@ 0 = IF
|
||||
I BLK-CELL@ STADIUM-HEAT@ 0 = IF
|
||||
I ART-DATA-LBN + BLK-FREE
|
||||
THEN
|
||||
THEN
|
||||
@@ -189,10 +236,14 @@ Block 4140
|
||||
: ART-TICK ( -- )
|
||||
ART-COOL ART-REAP ;
|
||||
Block 4127
|
||||
( Status )
|
||||
( Status. item 4.6: ARTEMIS-K mirrors HERMES-K -- block )
|
||||
( heat + reservoir + word-execution residents. )
|
||||
: ARTEMIS-K ( -- q48 )
|
||||
ART-K-TOTAL STADIUM-RES@ + STADIUM-WORD-HEAT + ;
|
||||
: ART-STATUS ( -- )
|
||||
." Artemis: " ART-DATA-BLKS . ." data blocks" CR
|
||||
." K-total=" ART-K-TOTAL Q.PRINT CR ;
|
||||
." K-total=" ART-K-TOTAL Q.PRINT CR
|
||||
." ARTEMIS-K=" ARTEMIS-K Q.PRINT CR ;
|
||||
: WELCOME ( -- ) ." Artemis ready" CR ART-STATUS ;
|
||||
Block 4132
|
||||
( Self-test: alloc/fetch/persist/free round-trip )
|
||||
@@ -242,7 +293,7 @@ Block 4136
|
||||
Block 4141
|
||||
( Artemis CD-INIT -- Hera calls this at fleet boot )
|
||||
: CD-INIT ( -- )
|
||||
BLK-HEAT ART-DATA-BLKS CELLS 0 FILL
|
||||
BLK-CELL-INIT-FREE
|
||||
LOG-INFO" Artemis: ready" ;
|
||||
Block 4133
|
||||
( Artemis entry -- runs at capsule load )
|
||||
@@ -319,23 +370,32 @@ Block 4171
|
||||
UNTIL
|
||||
S-CUR @ ;
|
||||
Block 4163
|
||||
( Write one trial: alloc a fresh random free block, )
|
||||
( tag it with a trial-derived pattern, and persist )
|
||||
( it through the real BLK-ALLOC-style path. )
|
||||
( Write one trial. item 4.6: admission can now be refused )
|
||||
( -- sentinel LBN=-1 on refusal, no unreserved write. )
|
||||
: SWRITE1 ( -- )
|
||||
SPICK S-IDX !
|
||||
S-IDX @ FM-SET
|
||||
Q.1 S-IDX @ BLK-HEAT!
|
||||
S-IDX @ BLK-ADMIT 0= IF
|
||||
-1 S-I @ SLBN! 0 S-I @ SPAT! EXIT
|
||||
THEN
|
||||
S-IDX @ ART-DATA-LBN + S-I @ SLBN!
|
||||
S-I @ 255 AND S-I @ SPAT!
|
||||
S-I @ SLBN@ BLK-FETCH
|
||||
1024 S-I @ SPAT@ FILL
|
||||
S-I @ SLBN@ BLK-PERSIST ;
|
||||
Block 4182
|
||||
( item 4.6 -- admit-refused trial: count + log + emit row. )
|
||||
: SV-REFUSED ( -- )
|
||||
1 ART-STRESS-FAIL +!
|
||||
-1 S-ACTUAL !
|
||||
." STRESS ADMIT-REFUSED trial=" S-I @ . CR
|
||||
SCSV-ROW ;
|
||||
Block 4164
|
||||
( Verify one trial: by now the 8-slot devblock cache )
|
||||
( has likely evicted and reloaded this block many )
|
||||
( times over -- a real round trip, not a cache hit. )
|
||||
( item 4.6: LBN=-1 means admission was refused; see 4182. )
|
||||
: SVERIFY1 ( -- )
|
||||
S-I @ SLBN@ -1 = IF SV-REFUSED EXIT THEN
|
||||
S-I @ SLBN@ BLK-FETCH C@ S-ACTUAL !
|
||||
S-ACTUAL @ S-I @ SPAT@ = IF
|
||||
1 ART-STRESS-PASS +!
|
||||
|
||||
Reference in New Issue
Block a user