From bd75003c81001cbf43b8fbae5121d0e67acef10c Mon Sep 17 00:00:00 2001 From: alice Date: Fri, 28 Aug 2026 19:36:24 +0000 Subject: [PATCH] vms-76c3: wire F$GETSYI("ARCH_NAME") in the DCL lexical + running per-arch battery coverage Closes out the F$GETSYI coverage. F$GETSYI("ARCH_NAME") was UNWIRED in the DCL lexical (dcl_lexical.c handled only VERSION/HW_NAME/...), so it fell through to "0" -- while the $GETSYI SERVICE (sys_misc.c SYI$_ARCH_NAME) already returned the real arch token via ovmx_hw_arch(). vms-10e made ovmx_hw_arch() report VAX/Alpha (was UNKNOWN), but only the host unit test covered it; the arch token had no running per-arch proof. - dcl_lexical.c: F$GETSYI("ARCH_NAME") -> ovmx_hw_arch() (the SAME SSOT the service uses, so the two surfaces never disagree). NOT space-padded (byte- confirmed on the live oracle: "Alpha" exact) -- a plain copy, unlike VERSION's fixed 8-char field. - shared battery: a bracketed WRITE F$GETSYI("ARCH_NAME") assertion (all three gates) against caller-provided EXPECTED_ARCH_NAME, plus a '[0]' bug guard for the old unwired fall-through. New EXPECTED_ARCH_NAME contract var. - gate drivers set their build arch: VAX -> "VAX", Alpha -> "Alpha", x86_64 -> "X86_64" / aarch64 -> "AARCH64". Cascade: API-compat additive (new item code, no caller breaks); test = the new runtime battery assertion (arch token now proven per-arch on a real boot, not just the host unit test); no doc. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01QSU1Hfy7UzVE6msx3hecWM --- src/vmsdcl/dcl_lexical.c | 9 +++++++++ tests/lab-vax/test_dcl_acceptance_vax.sh | 2 ++ tests/qemu/lib/dcl_acceptance_battery.sh | 14 ++++++++++++++ tests/qemu/test_dcl_acceptance_e2e.sh | 4 ++++ tools/cross-alpha/run-boot-alpha.sh | 4 ++++ 5 files changed, 33 insertions(+) diff --git a/src/vmsdcl/dcl_lexical.c b/src/vmsdcl/dcl_lexical.c index 50d07643c..335a24a58 100644 --- a/src/vmsdcl/dcl_lexical.c +++ b/src/vmsdcl/dcl_lexical.c @@ -1407,6 +1407,15 @@ static int lex_getsyi(struct dcl_context *ctx, const char *args, ovmx_compat_version_field(field); field[OVMX_VMS_VERSION_FIELD_LEN] = '\0'; strncpy(result, field, result_size - 1); + } else if (strcmp(s, "ARCH_NAME") == 0) { + /* Machine surface: the VMS-style architecture name (SYI$_ARCH_NAME), + * from the identity SSOT (INV-1) -- the SAME ovmx_hw_arch() the $GETSYI + * service (sys_misc.c SYI$_ARCH_NAME) returns, so the two surfaces never + * disagree. Was UNHANDLED here, so F$GETSYI("ARCH_NAME") fell through to + * "0"; real VMS returns the arch token ("VAX"/"Alpha"/"IA64"/"x86_64"). + * NOT space-padded (byte-confirmed on the live oracle: "Alpha" exact, no + * padding -- unlike VERSION's fixed 8-char field). rd vms-76c3. */ + strncpy(result, ovmx_hw_arch(), result_size - 1); } else if (strcmp(s, "HW_NAME") == 0) { strncpy(result, uts.machine, result_size - 1); for (size_t i = 0; result[i]; i++) diff --git a/tests/lab-vax/test_dcl_acceptance_vax.sh b/tests/lab-vax/test_dcl_acceptance_vax.sh index e5911a1d5..62843c20f 100755 --- a/tests/lab-vax/test_dcl_acceptance_vax.sh +++ b/tests/lab-vax/test_dcl_acceptance_vax.sh @@ -74,6 +74,8 @@ export EXPECTED_BOOT_BANNER="$PNAME $PVER" CVER=$(idval OVMX_VMS_COMPAT_VERSION_VAX) [ -n "$CVER" ] || die "could not read OVMX_VMS_COMPAT_VERSION_VAX from $IDENTITY (rd vms-10e)" export EXPECTED_COMPAT_VERSION="$CVER" +# rd vms-76c3: F$GETSYI("ARCH_NAME") on a __vax__ build -> ovmx_hw_arch() = "VAX". +export EXPECTED_ARCH_NAME="VAX" # VOLUME_LABEL tracks master_system_volume's vmsfs_master --ods2 label; verify. export VOLUME_LABEL="OVMXSYS" diff --git a/tests/qemu/lib/dcl_acceptance_battery.sh b/tests/qemu/lib/dcl_acceptance_battery.sh index 17b0b3494..42912e762 100644 --- a/tests/qemu/lib/dcl_acceptance_battery.sh +++ b/tests/qemu/lib/dcl_acceptance_battery.sh @@ -38,6 +38,9 @@ # EXPECTED_COMPAT_VERSION -- the version F$GETSYI("VERSION") must report, # true-to-arch (ovmx_compat_version()): the real # VSI version on a lineage arch, else OVMX's own. +# EXPECTED_ARCH_NAME -- the arch token F$GETSYI("ARCH_NAME") must report, +# the gate's own build arch (ovmx_hw_arch()): +# "X86_64" / "AARCH64" / "VAX" / "Alpha". # VOLUME_LABEL -- the mastered ODS-2 system-disk label (OVMXSYS). # CMD_TIMEOUT -- per-command bound run_cmd passes to wait_for. # PASS / FAIL -- integer counters; ok/bad below increment them. @@ -201,6 +204,17 @@ run_dcl_acceptance_battery() { must_have "$SEG" "[${EXPECTED_COMPAT_FIELD}]" "WRITE F\$GETSYI [vms-28a]: F\$GETSYI(\"VERSION\") is the fixed 8-char space-padded VMS field '[${EXPECTED_COMPAT_FIELD}]' (not a trimmed token)" negctl "$SEG" 'F$GETSYI' "WRITE F\$GETSYI field" + # --- F$GETSYI("ARCH_NAME") reports the VMS arch token (vms-76c3) --------- + # Was UNWIRED in the DCL lexical -> fell through to "0"; real VMS reports the + # arch name ("VAX"/"Alpha"/"X86_64"), the SAME ovmx_hw_arch() the $GETSYI + # service returns (SYI$_ARCH_NAME). Bracket it (robust; NOT space-padded -- + # the oracle confirmed "Alpha" exact, no padding). EXPECTED_ARCH_NAME is + # caller-provided (the gate's own build arch), so each arch asserts its own. + run_cmd 'WRITE SYS$OUTPUT "[" + F$GETSYI("ARCH_NAME") + "]"' + must_have "$SEG" "[${EXPECTED_ARCH_NAME}]" "WRITE F\$GETSYI [vms-76c3]: F\$GETSYI(\"ARCH_NAME\") reports the VMS arch token '[${EXPECTED_ARCH_NAME}]'" + must_not_have "$SEG" '[0]' "WRITE F\$GETSYI [vms-76c3]: F\$GETSYI(\"ARCH_NAME\") is NOT the unwired '[0]' fall-through" + negctl "$SEG" 'F$GETSYI' "WRITE F\$GETSYI ARCH_NAME" + # --- SHOW QUOTA (vms-73c4: fabricated "[200,1]") ------------------------ run_cmd 'SHOW QUOTA' # VMS-faithful: either the real current UIC ([1,4] for SYSTEM) OR an honest diff --git a/tests/qemu/test_dcl_acceptance_e2e.sh b/tests/qemu/test_dcl_acceptance_e2e.sh index 6b80606e3..efd0228e2 100755 --- a/tests/qemu/test_dcl_acceptance_e2e.sh +++ b/tests/qemu/test_dcl_acceptance_e2e.sh @@ -78,10 +78,14 @@ if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then QEMU=qemu-system-aarch64 MACHINE="-machine virt -cpu cortex-a57" CONSOLE="console=ttyAMA0" + # rd vms-76c3: F$GETSYI("ARCH_NAME") on an __aarch64__ build -> ovmx_hw_arch() = "AARCH64". + EXPECTED_ARCH_NAME="AARCH64" else QEMU=qemu-system-x86_64 MACHINE="" CONSOLE="console=ttyS0" + # rd vms-76c3: F$GETSYI("ARCH_NAME") on an __x86_64__ build -> ovmx_hw_arch() = "X86_64". + EXPECTED_ARCH_NAME="X86_64" fi for f in "$KERNEL" "$SLIM_INITRD" "$DISTRIB_IMG"; do diff --git a/tools/cross-alpha/run-boot-alpha.sh b/tools/cross-alpha/run-boot-alpha.sh index 6f5a482cb..ad5527f86 100755 --- a/tools/cross-alpha/run-boot-alpha.sh +++ b/tools/cross-alpha/run-boot-alpha.sh @@ -287,6 +287,9 @@ derive_expected_identity() { cver=$(idval OVMX_VMS_COMPAT_VERSION_ALPHA) [ -n "$cver" ] || die "could not read OVMX_VMS_COMPAT_VERSION_ALPHA from $IDENTITY (rd vms-10e)" EXPECTED_COMPAT_VERSION="$cver" + # rd vms-76c3: F$GETSYI("ARCH_NAME") on an __alpha__ build -> ovmx_hw_arch() = + # "Alpha" (mixed case, byte-confirmed on the live lab-Alpha oracle). + EXPECTED_ARCH_NAME="Alpha" # VOLUME_LABEL tracks build-alpha-bootimage.sh's master step; verify the source # still uses it so a relabel there cannot silently desync this gate. VOLUME_LABEL="OVMXSYS" @@ -324,6 +327,7 @@ run_acceptance_boot() { LOGIN_USER="'"${LOGIN_USER:-SYSTEM}"'"; LOGIN_PASS="'"${LOGIN_PASS:-MANAGER}"'" export EXPECTED_BOOT_BANNER="'"$EXPECTED_BOOT_BANNER"'" export EXPECTED_COMPAT_VERSION="'"$EXPECTED_COMPAT_VERSION"'" + export EXPECTED_ARCH_NAME="'"$EXPECTED_ARCH_NAME"'" export VOLUME_LABEL="'"$VOLUME_LABEL"'" # qemu-system-alpha -M clipper RTC reads ~20 years off (emulator epoch # quirk); OVMX faithfully reports that guest clock, so the SHOW TIME battery