Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,40 @@ jobs:
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
Expand Down
12 changes: 8 additions & 4 deletions ARCHITECTURE.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"anima (consciousness daemon — anima clone 0)",
"sim-universe (reference layout v1.0.0)"
],
"forensic_verdict": "SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0 — every module present + individually compiles/probes; validated_manjeom = 0 (no real game frames evidenced). See README.md#caveats-raw10-c3.",
"forensic_verdict": "SKELETON_TIER_WIN32 + E5_PIPELINE_PROVEN — every module compiles/probes; the PE→D3D11→Metal pipeline is now proven end-to-end (r12: a self-authored own1 49-byte D3D11 PE executes through the i386 interpreter → D3D11→Metal bridge → real Apple Metal headless offscreen frame, pixel-readback verified · px_clear=0x0000FFFF px_triangle=0xFF0000FF nonuniform=1). validated_manjeom = first_own1_authored_d3d11_pe_to_metal_frame (infrastructure milestone, NOT a commercial game). NO commercial game frame evidenced yet — a real game needs the full Win32/D3D11 API surface + real assets + the real game's PE. See README.md#caveats-raw10-c3.",
"own1": "Wine 0 / DRM bypass 0 / Warden bypass 0 / anti-cheat bypass 0 (5 classes: VAC + GameGuard + EAC kernel + EAC anti-tamper + Warden) / FromSoft matchmaking bypass 0 / anima clone 0 / destructive_ops 0.",
"own2": "every subcommand emits an explicit PASS/FAIL/PARTIAL/RETIRED_INTENTIONAL reason; predecessor markers preserved verbatim for traceability.",
"version": "1.0.4",
Expand All @@ -20,15 +20,15 @@
"children": [
{
"name": "ℹ️ skeleton-tier status",
"summary": "Skeleton-tier: every loader/perf module compiles + probes, but no real game frames are evidenced (validated_manjeom = 0; forensic verdict SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0)."
"summary": "Skeleton-tier loaders/perf compile + probe; the PE→D3D11→Metal pipeline is proven end-to-end with a self-authored own1 D3D11 PE (r12, pixel-readback verified) = validated_manjeom first_own1_authored_d3d11_pe_to_metal_frame (infrastructure milestone). NO commercial game frame evidenced yet (real game = full Win32/D3D11 surface + real assets + real PE)."
},
{
"name": "🚧 blocking-frontiers — validated_manjeom>0 경로 (fleet-lab SSOT)",
"summary": "validated_manjeom=0(실 게임 프레임 미증명) 돌파의 명명된 사다리 = native E-series (docs/CLOSURE_ROADMAP.md §5). fleet-lab F-NSWINDOW-E5 가 추적. 각 라운드 measured 결과를 여기 update-in-place 박제 → 차세션 research 가 흩어진 메모리 대신 한 곳에서 표적을 본다.",
"children": [
{
"name": "F-NSWINDOW-E5 — E1✅ E2✅ E3✅ E4✅(IAT name-autobind) E5🛠️(Metal substrate proven)",
"summary": "validated_manjeom=0 돌파 사다리(docs/CLOSURE_ROADMAP.md §5). E1 PE-parse+mmap done·E2 i386 디코더 done·E3 i386 인터프리터 done(실 game-binary EXECUTE)·E4 kernel32 IAT name-autobind done(합성 prologue CRT→user-entry handoff·insns=60·K32 13·IAT name-autobind)·E5 Metal substrate IN-PROGRESS: r10(#32) 헤드리스 Metal 오프스크린 렌더+readback 로컬 PASS(M4·Apple M4 device)·CI 러너 ground-truth 확인 중. 다음 r11 = D3D11 device shim → Metal 오프스크린 경로 배선."
"name": "F-NSWINDOW-E5 — E1✅ E2✅ E3✅ E4✅(IAT name-autobind) E5✅(r12: PE→D3D11→Metal 인프라 마일스톤)",
"summary": "validated_manjeom 사다리(docs/CLOSURE_ROADMAP.md §5). E1 PE-parse+mmap done·E2 i386 디코더 done·E3 i386 인터프리터 done(실 game-binary EXECUTE)·E4 kernel32 IAT name-autobind done(합성 prologue CRT→user-entry handoff·insns=60·K32 13·IAT name-autobind)·E5 r10-r12 완료: r10 헤드리스 Metal 오프스크린 렌더+readback PASS·r11 D3D11→Metal 브리지 네이티브 PASS·r12 PE→D3D11→Metal end-to-end PASS(insns=11 imports=7 px_clear=0x0000FFFF px_triangle=0xFF0000FF nonuniform=1). validated_manjeom=first_own1_authored_d3d11_pe_to_metal_frame(인프라 마일스톤·상업 게임 아님). 다음: 상업 게임 방향 — Win32 API 서피스 확장·opcode 커버리지·vtable [reg+offset] 간접 call·실 게임 PE IAT 추적."
},
{
"name": "E4 r5 measured (2026-06-26·#19/24/25/26 merged) — 18명령 실행·kernel32 5 import 바인딩",
Expand All @@ -46,6 +46,10 @@
"name": "E5 r11 measured (2026-06-26) — D3D11→Metal 브리지 네이티브 증명 (구현됨·미배선)",
"summary": "native/d3d11_metal_bridge.{h,m} (C헤더+ObjC+Metal+Foundation): D3D11-인터페이스-형상 COM 오브젝트(ID3D11Device·ID3D11DeviceContext·IDXGISwapChain·ID3D11RenderTargetView·ID3D11Texture2D) + 컴팩트 vtable(구현 메서드만; IUnknown 스텁 [0-2] 포함). gamebox_D3D11CreateDeviceAndSwapChain → MTLDevice+오프스크린 64×64 BGRA8 backBuffer+인라인 MSL PSO. ClearRenderTargetView=loadAction:Clear 독립 패스; Draw=loadAction:Load+삼각형; Present=no-op(헤드리스). gamebox_d3d11_readback=[MTLTexture getBytes:]. native/d3d11_metal_bridge_test.c(순수 C): vtable 포인터 경로로 CreateDeviceAndSwapChain→GetBuffer→CreateRenderTargetView→OMSetRenderTargets→ClearRenderTargetView(blue)→Draw(3,0)→Present→readback→픽셀 어서션. 로컬 M4 결과(빌드 clean·-Wall -Wextra 경고 없음): __D3D11_BRIDGE__ PASS px_clear=0x0000FFFF px_triangle=0xFF0000FF nonuniform=1. CI warn-only 스텝 추가(r10 패턴). own1: Wine 0·DXVK 0·d3d11.dll 소스 0·DRM 0. 구현됨·미배선 dead-until-wired — 인터프리터를 통한 PE 구동은 r12. validated_manjeom=0(네이티브 테스트·게임 프레임 아님). 다음 r12: 최소 D3D11 테스트 PE(own1 자작 i386 PE) + 인터프리터 IAT autobind 배선 → 이 브리지 shim → Metal 오프스크린 → readback = validated_manjeom>0 게이트."
},
{
"name": "E5 r12 measured (2026-06-26) — 첫 own1 D3D11 PE → Metal 프레임 (인프라 마일스톤) ✅",
"summary": "native/e5_end_to_end_test.c: 자작 i386 PE32(9명령·49바이트·d3d11.dll 7 import) → i386 인터프리터 IAT autobind(by name·own 임포트 로딩) → 브리지 shim layer(7 C 래퍼) → gamebox D3D11→Metal 브리지(d3d11_metal_bridge.m) → Apple Metal 헤드리스 오프스크린 렌더(64×64 BGRA8) → 픽셀 readback → 어서션. 로컬 M4 실측: __E5__ PASS pe_executed=1 frame_rendered=1 px_clear=0x0000FFFF px_triangle=0xFF0000FF nonuniform=1 insns=11 imports=7. own1: Wine 0·DXVK 0·d3d11.dll 0·DRM 0·게임 애셋 0. 정직 평가: validated_manjeom=first_own1_authored_d3d11_pe_to_metal_frame (인프라 마일스톤). 상업 게임 아님 — 실 게임은 전체 Win32/D3D11 API 서피스·실 애셋·실 PE 필요. 다음: Win32 API 서피스 확장·opcode 커버리지·vtable [reg+offset] 간접 call·실 게임 PE IAT 추적."
},
{
"name": "🧱 E5 게이트 재분류 (2026-06-26 실측 — substrate/투자 프론티어, 하드웨어 천장 아님)",
"summary": "validated_manjeom>0(실 프레임) 도달 게이트를 실측 재분류. ① real i386 D3D PE — 최소 D3D11 테스트 PE 자작 가능(own1 클린·꼭 AAA 아님). ② D3DMetal SDK — 'CI 부재'는 틀림: `brew tap apple/apple && brew install game-porting-toolkit`로 Blacksmith macos-15(실 Apple Silicon·GPU)에 설치 가능(하드웨어 무관). ③ 디스플레이 — 불필요: Metal 헤드리스(오프스크린 MTLTexture→getBytes readback)로 화면 없이 프레임 증명 가능(M4/Metal4 확인). → 진짜 벽 = 엔지니어링 거리: lib/loader/dx_d3d11.hexa 등 DX→Metal 브리지는 MTL* 이름만 적힌 텔레메트리 스캐폴드(실 Metal 호출 0건). 다음 사다리(자율가능, 실-GPU CI 위): real-PE IAT name-autobind → 넓은 opcode 커버 → D3D11 device shim → 실 MTLDevice/오프스크린 → readback. 이전 'real-asset user-only 게이트' 분류는 verify 안 한 게으른 벽(break-walls 위반)이라 정정."
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@ All notable changes to `gamebox` are documented in this file.

### Added

- feat(F-NSWINDOW-E5 r12): **PE→D3D11→Metal end-to-end: 첫 own1 D3D11 PE → Metal 프레임 (인프라 마일스톤)**
— r11 이 증명한 D3D11→Metal 브리지를 인터프리터에 배선하고, 자작 최소 i386 PE 를 실행하여
실제 Metal 렌더 프레임을 픽셀로 읽어 검증한다.
**정직한 평가(own2)**: 이것은 인프라 마일스톤 — gamebox 런타임이 자작 own1 D3D11 PE 를 인터프리터로
실행해 Metal 렌더 프레임을 픽셀로 증명한 *첫 번째* 케이스다. 실 상업 게임(디아블로·리니지 등)
실행과 동일하지 않다: 전체 Win32/D3D11 API 서피스·실 애셋·실 게임 PE 가 필요하다.
**validated_manjeom**: `first_own1_authored_d3d11_pe_to_metal_frame` (정확한 라벨,
"상업 게임 프레임" 아님). **own1**: Wine 0·DXVK 0·d3d11.dll 소스 0·DRM 0·Warden 0·
게임 애셋 0·anima clone 0.
**로컬 M4 실측 결과**:
`__E5__ PASS pe_executed=1 frame_rendered=1 px_clear=0x0000FFFF px_triangle=0xFF0000FF nonuniform=1 insns=11 imports=7`
(1) **`native/e5_end_to_end_test.c`** — E5 r12 end-to-end 테스트 (순수 C):
(a) 브리지 오브젝트 테이블(g_sc·g_dev·g_ctx·g_tex·g_rtv 정적 전역,
g_skip/g_fail 상태 플래그); (b) 7개 브리지 shim(d3d11_create 2-arg stdcall 8B
pop·get_buffer/create_rtv/omset/clear_blue/draw/present 0-arg; 각각 gamebox
D3D11→Metal 브리지 C API 래핑); (c) D3D11_SHIMS 레지스트리 7엔트리 → i386_iat_autobind;
(d) `build_e5_pe_flat()` — i386 PE32 평탄 이미지 빌더: .text(RVA 0x1000,
49바이트 코드)+.idata(RVA 0x2000, d3d11.dll 7 named import; IMAGE_IMPORT_DESCRIPTOR
+INT+IAT+IBN 레이아웃) in-memory 구성; (e) main(): PE 빌드→autobind(total=7 bound=7
unbound=0)→CPU 설정+실행(insns=11 halt=ret)→readback→픽셀 어서션→`__E5__ PASS/PARTIAL/SKIP`
출력 프로토콜. (2) **`native/fixtures/d3d11_triangle_min.pe.txt`** — 자작 PE 완전 레이아웃
문서(파일 오프셋·VA·섹션·IAT 슬롯·import 이름→shim 매핑·정직 평가). (3) PE 엔트리 코드 (49바이트,
i386 hand-assembled, Intel SDM 명시): `6A 40 6A 40`(push height/width=64) +
`FF 15 [slot]`×7(IAT call; 기존 인터프리터 커버리지) + `33 C0 C3`(xor+ret).
디코더 확장 없음(기존 PUSH_IMM8·CALL_RM·XOR_R_RM·RET 그대로 사용). (4) IAT 슬롯 VA:
0x402080(create)·0x402084(get_buf)·0x402088(rtv)·0x40208C(omset)·0x402090(clear)·
0x402094(draw)·0x402098(present). (5) **`native/build.sh`** — `e5_end_to_end_test` 타깃
추가(ObjC ARC·Metal/Foundation). (6) **`.github/workflows/ci.yml`** —
`Smoke — E5 end-to-end (PE→D3D11→Metal)` 스텝 추가: D3D11 브리지 스텝 직후.
`__E5__ PASS/SKIP/PARTIAL/FAIL` 파싱, warn-only(r10/r11 패턴). ARCHITECTURE.json
blocking-frontiers r12 실측 기록.
**체인 설명(정직)**: own1 자작 i386 PE(9명령·49바이트) → i386 인터프리터(i386_cpu.c)
IAT autobind(by name, own 임포트 로딩=로딩이지 바이패스 아님) → 브리지 shim layer →
gamebox D3D11→Metal 브리지(d3d11_metal_bridge.m) → Apple Metal 헤드리스 오프스크린
렌더(64×64 BGRA8 MTLTexture) → 픽셀 readback(getBytes) → 어서션(blue clear ∧ red
triangle ∧ nonuniform). **다음 상업 게임 방향**: Win32 API 서피스 확장·opcode 커버리지
확장·vtable 디스패치([reg+offset] 간접 call)·실 게임 PE IAT 추적.

- feat(F-NSWINDOW-E5 r11): **D3D11→Metal 브리지 + 네이티브 드라이버 테스트 (구현됨·미배선)**
— r10 이 증명한 헤드리스 Metal 오프스크린 렌더 서브스트레이트 위에, D3D11-인터페이스-형상의
Metal 브리지를 구축하고 네이티브 드라이버 테스트로 검증한다.
Expand Down
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
> Skeleton-tier 100% Win32 fn coverage (435/435) + 18+ perf families at 100%
> manjeom + 15 .roadmap.* SSOT (14 active + 1 historical wow) + 7 .checkpoint.*
> (3 met post Track BV) + 4 hexa-lang upstream RFCs merged.
> **Forensic verdict (2026-05-05): SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0**
> honest C3: validated_manjeom = 0 (no real game frames evidenced).
> **Forensic verdict: SKELETON_TIER_WIN32 + E5_PIPELINE_PROVEN** — the
> PE→D3D11→Metal pipeline is proven end-to-end (r12: a self-authored own1 D3D11
> PE runs through the i386 interpreter → D3D11→Metal bridge → real Metal frame,
> pixel-readback verified). honest C3: validated_manjeom =
> `first_own1_authored_d3d11_pe_to_metal_frame` (infrastructure milestone) —
> **NO commercial game frame evidenced yet** (a real game needs the full
> Win32/D3D11 surface + real assets + the real game's PE).

> **Distribution**: GitHub canonical at <https://github.com/dancinlab/gamebox>.
> CLI tooling installed via `hx install gamebox` from the hexa-lang registry,
Expand All @@ -36,7 +41,7 @@
- 18+ perf families at 100% manjeom; 242 c_*_*.hexa modules across 104 unique families
- 15 .roadmap.* SSOT (14 active + 1 historical wow), 7 .checkpoint.* (3 met post Track BV)
- 4 hexa-lang upstream RFCs merged
- Forensic verdict: `SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0` — honest C3, no real game frames evidenced
- Forensic verdict: `SKELETON_TIER_WIN32 + E5_PIPELINE_PROVEN` — honest C3: PE→D3D11→Metal proven end-to-end with a self-authored own1 PE (r12); no commercial game frame evidenced yet

---

Expand Down Expand Up @@ -329,14 +334,19 @@ PR #47 squash-merged 2026-05-04 (Track AY). PR #48 merged 2026-05-04 (Track BD/B
---


> The forensic verdict `SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0` carries
> The forensic verdict `SKELETON_TIER_WIN32 + E5_PIPELINE_PROVEN` carries
> 5 explicit honesty caveats. **Read these before assuming gamebox runs games.**

1. **`validated_manjeom = 0`**. Skeleton-tier means the loader / perf modules
are present and individually compile / probe; **no real game frames have
been evidenced**. Closure milestones CM-26..CM-30 (per
`docs/CLOSURE_ROADMAP.md` §5) — hexa interp full launch + first-frame
render + sustained-frame render — are **NOT** done.
1. **`validated_manjeom = first_own1_authored_d3d11_pe_to_metal_frame` (infra
milestone, NOT a commercial game)**. The PE→D3D11→Metal pipeline is proven
end-to-end: a self-authored own1 49-byte D3D11 PE executes through the i386
interpreter → D3D11→Metal bridge → a real Apple Metal headless offscreen
frame, pixel-readback verified (r12 · `native/e5_end_to_end_test.c`). But
**no commercial game frame has been evidenced** — a real game (Diablo /
Lineage / …) needs the full Win32/D3D11 API surface, real assets, and the
real game's PE. Closure milestones CM-26..CM-30 (per
`docs/CLOSURE_ROADMAP.md` §5) — full launch + first-frame + sustained-frame
render of a **real game** — are **NOT** done.

2. **own1 invariant carries**. Wine 0 / DRM bypass 0 / Warden bypass 0 /
anti-cheat bypass 0 / anima clone 0. `c_bnet_warden_environment_compat`
Expand Down Expand Up @@ -366,13 +376,16 @@ PR #47 squash-merged 2026-05-04 (Track AY). PR #48 merged 2026-05-04 (Track BD/B
## Forensic verdict

```
SKELETON_TIER_100PCT_WIN32_VALIDATED_MANJEOM_0
SKELETON_TIER_WIN32 + E5_PIPELINE_PROVEN
```

- **skeleton_manjeom = 100%**: 435/435 Win32 fn coverage + 18+ perf families
at 100% (Track BL/BM forensic). Win32 100% milestone (Track BP) attained
2026-05-05.
- **validated_manjeom = 0%**: no real game frames; closure CM-26..CM-30 not done.
- **validated_manjeom = `first_own1_authored_d3d11_pe_to_metal_frame`**: the
PE→D3D11→Metal pipeline renders a real Metal frame from a self-authored own1
D3D11 PE (r12, pixel-readback verified) — an infrastructure milestone. **No
commercial game frame yet**; real-game closure CM-26..CM-30 not done.
- **provenance**: 67 BG cycles cumulative session (2026-05-03 to 2026-05-05).
- **session predecessor**: `dancinlife/airgenome-gamebox` (DELETED 2026-05-05
per Option B + closure cycle directive; history not transferred per D3 fresh-start
Expand Down
15 changes: 14 additions & 1 deletion native/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,17 @@ echo "[build] codesigning d3d11_bridge_test (ad-hoc)"
codesign --force --sign - --timestamp=none d3d11_bridge_test
codesign --verify --verbose=2 d3d11_bridge_test || true

echo "[build] done — ./pe_to_macho_shim <pe.exe> / ./i386_decode_test <pe.exe> [count] / ./i386_cpu_test [pe.exe] / ./metal_offscreen_smoke / ./d3d11_bridge_test"
# e5_end_to_end_test — F-NSWINDOW-E5 r12: PE→D3D11→Metal end-to-end (own1).
# Self-authored i386 PE32 + interpreter IAT autobind → D3D11 bridge shims →
# d3d11_metal_bridge.m → Apple Metal headless → pixel readback.
# own1: no Wine, no DXVK, no game asset, no DRM.
echo "[build] compiling e5_end_to_end_test (arch=arm64, sdk=macosx, ObjC+Metal)"
"$CC" -arch arm64 -isysroot "$SDK" -fobjc-arc -O2 -Wall -Wextra \
-framework Metal -framework Foundation \
-o e5_end_to_end_test \
e5_end_to_end_test.c i386_cpu.c i386_decode.c pe_parse.c d3d11_metal_bridge.m
echo "[build] codesigning e5_end_to_end_test (ad-hoc)"
codesign --force --sign - --timestamp=none e5_end_to_end_test
codesign --verify --verbose=2 e5_end_to_end_test || true

echo "[build] done — ./pe_to_macho_shim <pe.exe> / ./i386_decode_test <pe.exe> [count] / ./i386_cpu_test [pe.exe] / ./metal_offscreen_smoke / ./d3d11_bridge_test / ./e5_end_to_end_test"
Loading
Loading