Skip to content

docs: session-close cleanup โ€” collapse E5 round history + retire manjโ€ฆ #47

docs: session-close cleanup โ€” collapse E5 round history + retire manjโ€ฆ

docs: session-close cleanup โ€” collapse E5 round history + retire manjโ€ฆ #47

Workflow file for this run

# gamebox CI โ€” build + test on a GitHub-hosted Apple-Silicon macOS runner.
#
# WHY: gamebox is Apple-native (Win32 PE loader + D3DMetal), so its hexa source
# compile + the apple-only test suite need a macOS host. Running that locally on
# the dev Mac (242+ perf modules + 8 test files) spikes memory and crashes the
# machine. Offloading to a cloud macOS runner keeps every build off the local
# Mac โ€” the dev box only ever does `git push`.
#
# Runner: github-hosted `macos-15` (Apple-Silicon). gamebox is a PUBLIC repo, so
# GitHub-hosted macOS minutes are FREE โ€” this replaced the paid Blacksmith runner
# (`blacksmith-6vcpu-macos-15`) on owner instruction to stop CI cost. Pin to
# macos-15 (NOT -26): the SDK baseline rides the builder, and macos-15 keeps the
# Mach-O min-OS floor stable (mirrors the hexa-lang release.yml rationale).
#
# The hexa toolchain is the released binary (gamebox is a downstream consumer,
# not the compiler repo), installed verbatim via the canonical one-liner.
name: gamebox-ci
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: gamebox-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-test:
name: build + test (darwin-arm64, github-hosted)
runs-on: macos-15
timeout-minutes: 25
steps:
- uses: actions/checkout@v6
- name: Install hexa toolchain (released binary)
shell: bash
run: |
set -euo pipefail
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/dancinlab/hexa-lang/main/install.sh)"
echo "$HOME/.hx/bin" >> "$GITHUB_PATH"
- name: Sanity โ€” hexa runs
shell: bash
run: |
set -euo pipefail
hexa --version || true
hexa --help >/dev/null
# โ”€โ”€ Test suite โ€” the 8 self_test files from hexa.toml [test].files.
# These files are `fn self_test()` + `main()` dispatch (own2 mandate), NOT
# `@test` fns โ€” so they MUST be invoked via `hexa run <file> self-test`
# (which dispatches main()โ†’self_test()). `hexa test` runs only @test fns,
# finds zero, and passes VACUOUSLY โ€” so it must NOT be used here.
# D3DMetal SDK is absent on the runner, but gamebox detection is warn-only
# (skeleton-tier loaders stay importable), so the apple-only + loader tests
# exercise compile + logic without the SDK.
- name: Test โ€” gamebox self_test suite
shell: bash
run: |
set -uo pipefail
fail=0
for t in \
tests/test_apple_only.hexa \
tests/test_closure.hexa \
tests/test_own2.hexa \
tests/test_d2r_archive_round_trip.hexa \
tests/test_d2r_d3d11_synthetic_scaffold.hexa \
tests/test_d2r_pe_synthetic_round_trip.hexa \
tests/test_purple_lineage_offline_shim.hexa \
tests/test_roadmap_op_self_impl.hexa ; do
echo "โ”€โ”€ $t โ”€โ”€"
if hexa run "$t" self-test; then
echo "PASS $t"
else
echo "::error::FAIL $t"
fail=1
fi
done
exit "$fail"
# โ”€โ”€ Native C โ€” i386 interpreter (E3 first-execution milestone).
# Compiles + RUNS native/i386_cpu_test (hermetic โ€” embeds the real
# Battle.net-Setup.exe entry block, no binary needed). It's a pure Intel-SDM
# interpreter (no JIT), so no codesign is needed to run it on the runner.
# This is the first gamebox code that EXECUTES (not just decodes) real
# game-binary bytes โ€” gate it so the milestone can't silently regress.
- name: Test โ€” native i386 interpreter (E3)
shell: bash
run: |
set -euo pipefail
SDK="$(xcrun --sdk macosx --show-sdk-path)"
clang -arch arm64 -isysroot "$SDK" -O2 -Wall -Wextra -std=c11 \
-o "$RUNNER_TEMP/i386_cpu_test" \
native/i386_cpu_test.c native/i386_cpu.c native/i386_decode.c native/pe_parse.c
out="$("$RUNNER_TEMP/i386_cpu_test")"
echo "$out"
echo "$out" | grep -q "__SHIM_TEST__ PASS" \
|| { echo "::error::native i386_cpu_test FAIL (E3 interpreter regression)"; exit 1; }
# โ”€โ”€ Metal offscreen smoke โ€” E5 substrate proof (F-NSWINDOW-E5 r10).
# Verifies that headless Metal offscreen render + pixel readback works on the
# runner (no display needed). own1: plain Apple Metal, no game asset, no Wine.
# validated_manjeom stays 0 โ€” this is a substrate proof, NOT a game frame.
#
# Warn-only: if the runner has no GPU session โ†’ __METAL_SMOKE__ SKIP (exit 0,
# no-device path). If it has a GPU โ†’ __METAL_SMOKE__ PASS (exit 0) or FAIL
# (exit 1, but we still only warn so a transient runner issue doesn't red the
# build). The grep surfaces whether we got PASS or SKIP in the CI log.
- name: Smoke โ€” headless Metal offscreen render (E5 substrate)
shell: bash
run: |
set -uo pipefail
SDK="$(xcrun --sdk macosx --show-sdk-path)"
clang -arch arm64 -isysroot "$SDK" -fobjc-arc -O2 -Wall -Wextra \
-framework Metal -framework Foundation \
-o "$RUNNER_TEMP/metal_offscreen_smoke" \
native/metal_offscreen_smoke.m \
|| { echo "::warning::metal_offscreen_smoke compile failed (E5 substrate โ€” warn-only)"; exit 0; }
out="$("$RUNNER_TEMP/metal_offscreen_smoke" 2>&1)" || true
echo "$out"
if echo "$out" | grep -q "__METAL_SMOKE__ PASS"; then
echo "E5-substrate: PASS โ€” headless Metal offscreen render confirmed on this runner"
elif echo "$out" | grep -q "__METAL_SMOKE__ SKIP"; then
echo "::warning::E5-substrate: SKIP โ€” no GPU/Metal session on this runner (ground-truth finding, not a failure)"
else
echo "::warning::E5-substrate: FAIL or no output โ€” see log above (warn-only)"
fi
# โ”€โ”€ D3D11โ†’Metal bridge smoke โ€” E5 r11 (F-NSWINDOW-E5 r11).
# Builds native/d3d11_metal_bridge.m + test.c and runs the native driver:
# CreateDeviceAndSwapChain โ†’ GetBuffer โ†’ CreateRenderTargetView โ†’
# OMSetRenderTargets โ†’ ClearRenderTargetView(blue) โ†’ Draw(triangle,red) โ†’
# Present โ†’ readback โ†’ pixel assertions (px_clear=0x0000FFFF,
# px_triangle=0xFF0000FF, nonuniform=1).
# own1: gamebox's own D3D11 *interface shape* over Apple Metal โ€” NOT Wine,
# NOT DXVK, NOT d3d11.dll source. No DRM, no game asset.
# ๊ตฌํ˜„๋จยท๋ฏธ๋ฐฐ์„  (dead-until-wired) โ€” proven native but not yet driven
# through the i386 interpreter (r12 target).
# validated_manjeom stays 0; this is a bridge proof, not a game frame.
#
# Warn-only: no-GPU runner โ†’ __D3D11_BRIDGE__ SKIP (exit 0).
# compile-fail or pixel assertion fail โ†’ ::warning:: (never ::error::).
# Same pattern as r10 Metal substrate step.
- name: Smoke โ€” D3D11โ†’Metal bridge (E5 r11)
shell: bash
run: |
set -uo pipefail
SDK="$(xcrun --sdk macosx --show-sdk-path)"
clang -arch arm64 -isysroot "$SDK" -fobjc-arc -O2 -Wall -Wextra \
-framework Metal -framework Foundation \
-o "$RUNNER_TEMP/d3d11_bridge_test" \
native/d3d11_metal_bridge_test.c native/d3d11_metal_bridge.m \
|| { echo "::warning::d3d11_bridge_test compile failed (E5 r11 โ€” warn-only)"; exit 0; }
out="$("$RUNNER_TEMP/d3d11_bridge_test" 2>&1)" || true
echo "$out"
if echo "$out" | grep -q "__D3D11_BRIDGE__ PASS"; then
echo "E5-r11-bridge: PASS โ€” D3D11โ†’Metal bridge native test confirmed on this runner"
elif echo "$out" | grep -q "__D3D11_BRIDGE__ SKIP"; then
echo "::warning::E5-r11-bridge: SKIP โ€” no GPU/Metal session on this runner (ground-truth finding, not a failure)"
else
echo "::warning::E5-r11-bridge: FAIL or no output โ€” see log above (warn-only)"
fi
# โ”€โ”€ E5 r12 end-to-end smoke โ€” PEโ†’D3D11โ†’Metal (F-NSWINDOW-E5 r12).
# Builds e5_end_to_end_test.c + d3d11_metal_bridge.m + interpreter and runs
# the full chain: own1 self-authored i386 PE โ†’ interpreter IAT autobind โ†’
# bridge shims โ†’ gamebox D3D11โ†’Metal bridge โ†’ Apple Metal headless โ†’
# pixel readback โ†’ assert clear=0x0000FFFF, triangle=0xFF0000FF, nonuniform=1.
#
# own1: self-authored PE, gamebox's own D3D11-shape over Apple Metal.
# No Wine, no DXVK, no d3d11.dll source. No DRM, no game asset.
# Honest verdict: infrastructure milestone (first own1 D3D11 PE โ†’ Metal frame).
# NOT a commercial game frame.
#
# Warn-only: no-GPU runner โ†’ __E5__ SKIP (exit 0, same as r10/r11).
# compile-fail or pixel assertion fail โ†’ ::warning:: (never ::error::).
- name: Smoke โ€” E5 end-to-end (PEโ†’D3D11โ†’Metal)
shell: bash
run: |
set -uo pipefail
SDK="$(xcrun --sdk macosx --show-sdk-path)"
clang -arch arm64 -isysroot "$SDK" -fobjc-arc -O2 -Wall -Wextra \
-framework Metal -framework Foundation \
-o "$RUNNER_TEMP/e5_end_to_end_test" \
native/e5_end_to_end_test.c native/i386_cpu.c native/i386_decode.c \
native/pe_parse.c native/d3d11_metal_bridge.m \
|| { echo "::warning::e5_end_to_end_test compile failed (E5 r12 โ€” warn-only)"; exit 0; }
out="$("$RUNNER_TEMP/e5_end_to_end_test" 2>&1)" || true
echo "$out"
if echo "$out" | grep -q "__E5__ PASS"; then
echo "E5-r12-e2e: PASS โ€” own1 self-authored D3D11 PE โ†’ Metal frame confirmed (infrastructure milestone)"
elif echo "$out" | grep -q "__E5__ SKIP"; then
echo "::warning::E5-r12-e2e: SKIP โ€” no GPU/Metal session on this runner (ground-truth finding, not a failure)"
else
echo "::warning::E5-r12-e2e: FAIL or PARTIAL or no output โ€” see log above (warn-only)"
fi
# โ”€โ”€ CLI smoke โ€” own2 PASS/FAIL/PARTIAL subcommands compile + run.
- name: Smoke โ€” gamebox CLI subcommands
shell: bash
run: |
set -uo pipefail
hexa run cli/gamebox.hexa -- status || echo "::warning::status non-zero (own2 PARTIAL/FAIL is honest, not a CI break)"
hexa run cli/gamebox.hexa -- selftest --quick || echo "::warning::selftest --quick non-zero (skeleton-tier, warn-only)"