feat: move to Rust: merge rust/full into main #351

Manually merged
github merged 184 commits from github-bot/gh-351 into main 2026-11-26 11:48:21 +00:00 AGit
Owner

@⁠LooperSalty on GitHub · 2026-11-26 11:05 UTC · original
LooperSalty:feat/rust-full-into-main → main · +50372 −2194 · 321 files · 184 commits · merged 2026-11-26 11:46 UTC

Brings the rust/full branch into main. It is up to date with main (as of #309) and includes the PRs that were waiting on it.

What it contains

  • rust/full (144 commits): root Cargo workspace crates/ replacing rust/.
    • Rust runtime DLLs xmem, kernelx, d3d12_xs, anyxboxx_tls and XCRDAPI.
    • Native launcher (#249) and GPU runner (#266) in Rust; the C++ versions stay as parity oracles.
    • RDNA 2 reference interpreter anyxboxx-rdna2-ref.
    • anyxboxx run, which replaces tools/lancer_victory.ps1 with the same settings, checked against the golden copy.
    • The graphical launcher anyxboxx-launcher (release launcher-v0.1.0).
  • #344: the Rust interpreter back to parity with the Python model (36/36).
  • #285 (Codex): xgameruntime ported to Rust and checked against the C++ DLL, which is still the one shipped.
  • #346: install guide for the launcher (docs/launcher.md, docs/fr/lanceur.md).
  • main (#342 drop Leonida, #308, #333, #309). One conflict, in AGENTS.md (the third_party/leonida row, dropped as main did).

Doc fixes made here

  • AGENTS.md: the layout names crates/ (not the removed rust/) and says what runtime/ still builds in C++. Setup now runs cargo before CMake, because rust_dlls.cmake stops a build whose Rust DLLs are missing. The game runs, so "does not run commercial games" and "blocked on a legally usable executable" are gone.
  • README (9 languages):
    • The 🦀 line now says the port is in main, with the launcher.
    • "The game is not playable" becomes "The game runs" (about 14 fps in the world, Series X mode, measured 2026-11-25).
    • Obsolete pictures removed: toy demo, SimpleTriangle and testgdk fps curves and capture, DLL bench, Python module diagram. Six image files deleted; the progress map and translation chart stay.
  • rust-full-status: the GPU runner is listed as ported, and the French page got its accents back (written as ? in #285).

Not done yet (after this PR)

  • The shipped xgameruntime.dll is still C++. Removing the C++ (runtime/, libhttpclient, oracles, CMake) comes next.
  • HLSL recompiler in Rust: #303, about 31 %. The plan says either port it or replace it with victory-shader.
  • The Python side (hle/, native/, Unicorn, tools/*.py) and moving pytest to cargo test.

Test plan

  • cargo build --release --workspace and cargo test --release --workspace: 505 passed, 0 failed (local, before the #309 merge)
  • tests/test_readme_sync.py: passes with the 9 README edits
  • Measured on the same combination (rust/full + #344 + #285 + main up to #342): pytest 1,786 passed, 1 skipped, ruff clean
  • Local re-run after the #309 merge, with the C++ runtime built (in progress)
  • CI green (pytest is the required check)
  • After merge: close #344, #346 and #285 as merged through this PR, retarget #303 to main

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox

**@⁠LooperSalty** on GitHub · 2026-11-26 11:05 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351) `LooperSalty:feat/rust-full-into-main` → `main` · +50372 −2194 · 321 files · 184 commits · merged 2026-11-26 11:46 UTC Brings the `rust/full` branch into `main`. It is up to date with `main` (as of #309) and includes the PRs that were waiting on it. ## What it contains - **`rust/full`** (144 commits): root Cargo workspace `crates/` replacing `rust/`. - Rust runtime DLLs xmem, kernelx, d3d12_xs, anyxboxx_tls and XCRDAPI. - Native launcher (#249) and GPU runner (#266) in Rust; the C++ versions stay as parity oracles. - RDNA 2 reference interpreter `anyxboxx-rdna2-ref`. - `anyxboxx run`, which replaces `tools/lancer_victory.ps1` with the same settings, checked against the golden copy. - The graphical launcher `anyxboxx-launcher` (release `launcher-v0.1.0`). - **#344**: the Rust interpreter back to parity with the Python model (36/36). - **#285** (Codex): xgameruntime ported to Rust and checked against the C++ DLL, which is still the one shipped. - **#346**: install guide for the launcher (`docs/launcher.md`, `docs/fr/lanceur.md`). - **`main`** (#342 drop Leonida, #308, #333, #309). One conflict, in `AGENTS.md` (the `third_party/leonida` row, dropped as `main` did). ## Doc fixes made here - `AGENTS.md`: the layout names `crates/` (not the removed `rust/`) and says what `runtime/` still builds in C++. Setup now runs cargo before CMake, because `rust_dlls.cmake` stops a build whose Rust DLLs are missing. The game runs, so "does not run commercial games" and "blocked on a legally usable executable" are gone. - README (9 languages): - The 🦀 line now says the port is in `main`, with the launcher. - "The game is not playable" becomes "The game runs" (about 14 fps in the world, Series X mode, measured 2026-11-25). - Obsolete pictures removed: toy demo, SimpleTriangle and testgdk fps curves and capture, DLL bench, Python module diagram. Six image files deleted; the progress map and translation chart stay. - `rust-full-status`: the GPU runner is listed as ported, and the French page got its accents back (written as `?` in #285). ## Not done yet (after this PR) - The shipped `xgameruntime.dll` is still C++. Removing the C++ (`runtime/`, libhttpclient, oracles, CMake) comes next. - HLSL recompiler in Rust: #303, about 31 %. The plan says either port it or replace it with victory-shader. - The Python side (`hle/`, `native/`, Unicorn, `tools/*.py`) and moving pytest to cargo test. ## Test plan - [x] `cargo build --release --workspace` and `cargo test --release --workspace`: 505 passed, 0 failed (local, before the #309 merge) - [x] `tests/test_readme_sync.py`: passes with the 9 README edits - [x] Measured on the same combination (`rust/full` + #344 + #285 + `main` up to #342): pytest 1,786 passed, 1 skipped, ruff clean - [ ] Local re-run after the #309 merge, with the C++ runtime built (in progress) - [ ] CI green (`pytest` is the required check) - [ ] After merge: close #344, #346 and #285 as merged through this PR, retarget #303 to `main` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The root Cargo.toml is the target workspace of the move to Rust. It
excludes rust/, third_party/ and .claude/ so the existing workspaces
(rust/, VIctory, TomBox) keep building unchanged.

anyxboxx-pe ports PrototypeScarlett/emu/loader.py (read_pe): header
checks, base choice, relocation, imports, exports, forwarders, TLS and
page protections. Tables are parsed by victory-pe, reused by path.
Its tests build PE32+ images from source, like tests/pe_builder.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Thirteen images built by pe_builder (imports, exports, forwarders,
forced and fallback bases, TLS, refused images) must give the same
JSON view, page protections included, in both loaders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pytest job builds crates/ before the suite, so the Rust/Python
parity tests find their binary (they fail in CI when it is missing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inventory, target crates around VIctory and TomBox, dependency diagram,
parity method, phases with done-when checklists and performance goals,
and the decisions left to the maintainer. English and French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same checks, cargo build of VIctory's diag profile, tuned environment, opt-in DRED, card rehash, skipped pipelines, xg_xs.dll with its mode, precompile step and exit code as the script. tests/test_anyxboxx_run.py runs both launchers with a fake cargo and victory.exe and compares the calls and the VICTORY_* environment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
anyxboxx-rdna2, anyxboxx-texture and anyxboxx-audio move to crates/; rust/Cargo.toml and its lock file are deleted, CI builds and tests one workspace, and the tests, tools and docs point at target/release. Clippy fixes in the moved crates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Victory::locate, build_command, translate_command, game_command, environment and status are public so the graphical launcher drives the same steps as the CLI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
anyxboxx-report ports emu/report.py and emu/config.py (MicrosoftGame.Config, UTF-8 and UTF-16). By default a function counts as resolved when VIctory binds it (HLE registry or allowed host DLL); --emulated-list takes another table. tests/test_rust_rapport_parity.py gives it the Python HLE registry and requires the same text as Python on 7 targets, and the same refusals on 5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/anyxboxx-xcrdapi ports runtime/xcrdapi (DStorageGetFactory, IDStorageFactoryX slot layout, E_NOTIMPL with cleared outputs). tests/test_rust_dlls.py assembles a runtime folder with the Rust DLL in place of the C++ one and runs tests/test_xcrdapi.py against it unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/anyxboxx-kernelx builds the forwarder table of tools/kernelx_exports.py into an export file with lib.exe (TomBox's method), since rustc's own .def ignores forwarders given as linker options. tests/test_rust_dlls.py now also compares each Rust DLL's export table with the C++ DLL's, and runs tests/test_kernelx.py against it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/anyxboxx-forwarders turns forwarders (and a crate's own exports) into an export file linked into the cdylib. crates/anyxboxx-d3d12-xs forwards the four root-signature functions to d3d12.dll and implements D3D12ConfigureVirtualMemoryX; tests/test_d3d12_virtual_memory.py and tests/test_runtime_cpp.py pass against it, and its export table equals the C++ DLL's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
New crate anyxboxx-launcher: the profiles live in one data file
(profiles.toml, embedded with include_str!). Windows + NVIDIA is the
maintainer's TUNED set, with the PR #199 switches set to 0 and marked
as pending confirmation. Linux (Proton) + AMD carries the settings of
PR #199's measured Linux run. Other combinations keep VIctory's
defaults, marked unmeasured. Host detection reads Wine's
wine_get_version export; the GPU vendor comes from DXGI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The environment reuses anyxboxx::run::environment for the game folder
and the XG library, then applies the profile and the user's overrides,
which win. Shader preloading and the game share that environment,
since the shader cache key depends on it.

The launch steps (build, translate with --jobs, run) come from the
shared anyxboxx::run pieces. Output is streamed line by line; the
translate progress line is parsed, and the cache location follows
VIctory's own rules. A running victory or game process refuses the
launch, and an unreadable process list refuses it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Checks the files VIctory needs (game_scarlett_master.exe, shaders.rpf,
the two DLLs of --precompile) for presence, emptiness, and the
structure of their headers: PE sections inside the file, RPF7 tables
inside the file. Hashes every required file and top-level archive into
a SHA-256 manifest. The launcher ships no expected hashes or sizes, so
the manifest records the folder rather than proving its build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rust toolchain (rustc --version), DirectX 12 runtime (d3d12.dll),
VC++ redistributable (VCRUNTIME140 and MSVCP140 present), Windows SDK
dxc.exe (newest Kits version), and the GPU driver. The driver has no
minimum recorded in this repository, so it is reported as unknown with
the adapter name and the vendor's driver page. Nothing is downloaded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Four pages: setup checklist, game folder check and manifest, shader
preloading with a progress bar and its worker limit, and play with the
profile, the XG library option, an advanced panel (overrides, guard
skip, the environment the launch will use) and a confirmed shader
cache clean. Long work runs on threads and streams into one log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Commands to build and run anyxboxx run and the graphical launcher, per-component status (ported, parity check, still Python or C++), check results and findings. English and French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The suite counts 1226 tests on rust/full rebased on main (parity tests of the Rust ports included); the status page gets the new count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The maintainer's test gave 2-3 fps on main after PR #199 with or without its switches at 0 (5-7 fps on fork 80d58f8): the profile keeps only the six tuned settings, marked measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/anyxboxx-xcrdapi passed the C++ DLL's tests and export table. runtime/CMakeLists.txt now copies the Rust runtime DLLs from target/release into runtime/build/bin (rust_dlls.cmake stops with the command to run if one is missing), so cargo build --release comes before cmake in CI, AGENTS.md, day-one and the 9 READMEs. tests/test_xcrdapi.py runs against the Rust DLL directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The forwarder table moves to crates/anyxboxx-kernelx/kernelx_forwarders.inc, where tools/kernelx_exports.py now writes it; runtime/ copies the Rust kernelx.dll. tests/test_kernelx.py runs against it directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
runtime/ copies the Rust d3d12_xs.dll; tests/test_d3d12_device_slots.py reads its exports from crates/anyxboxx-d3d12-xs instead of the deleted .def file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
anyxboxx run passed the parity test against the script (same calls, environment and exit codes). tests/test_anyxboxx_run.py keeps those expectations against the Rust launcher alone, tests/test_lanceur_victory.py checks its settings (tuned set, no relay, opt-in DRED and XG, every variable read by VIctory). Docs and the 9 READMEs give the anyxboxx run command lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The TLS carrier's own TLS block holds only the 256 KiB + 64 B carrier (262,208 bytes, no Rust std thread-locals the game's template would overwrite); its _tls_used directory is written in global_asm so it is not exported, and the export table equals the C++ one. tests/test_native_tls.py and test_native_tls_callbacks.py pass against it. no_std needs panic = "abort", which Cargo only accepts for the whole release profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
runtime/ copies the no_std Rust TLS carrier; tests/test_native_tls.py and test_native_tls_callbacks.py run against it directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XMemAlloc's XALLOC_ATTRIBUTES split (object type, page size, allocator,
alignment, memory type, reserved), public and repr(C), so AnyXboxX's
xmem.dll reuses it. VIctory's own XMemAlloc alignment now reads it; same
values as before (log2 at bit 24, 16 bytes at least).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of runtime/xmem (C++): same 16 exports, same behaviour (ERA heap,
XMemAlloc/XMemFree and hooks, XMemVirtualQuery with the +0x30 graphics
byte, XMemVirtualAlloc, physical page identifiers, refused statistics and
transfer). The ERA split and XMemIsToolsMemAvailable come from VIctory's
xmem module; the other VIctory versions differ on purpose (see lib.rs).
Xbox2Windows' MIT notice kept. Checked with test_xmem_era.py,
test_xmem_virtual.py and test_runtime_cpp.py against the Rust DLL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_xmem_era.py, test_xmem_virtual.py and test_runtime_cpp.py pass against crates/anyxboxx-xmem, whose export table equals the C++ DLL's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
runtime/ copies the Rust xmem.dll (crates/anyxboxx-xmem, ERA attributes shared with VIctory's xmem module); the xmem tests run against it directly. THIRD_PARTY.md points the Xbox2Windows port at the Rust files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Entry points of runtime/xgameruntime with the C++ results: the four
initialisers (forwarded to Windows' runtime when installed), QueryApiImpl
(E_NOINTERFACE for unknown pairs, output nulled first), XErrorReport,
XGameRuntimeInitialize/Uninitialize and XSystemGetDeviceType (7).

The served-interface table and the GDK slot counts are parsed from the
same served_interfaces.inc and gdk_api_table.inc as the C++ runtime, so
each served object has the method table size of the C++ one. Methods
are not written yet: they answer E_NOTIMPL and log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of registry.cpp: the console's OEM key (ConsoleMode 0x64, Series X)
is simulated for AnyXboxX_RegOpenKeyW/ExW, AnyXboxX_RegQueryValueExW and
AnyXboxX_RegCloseKey; every other key goes to the real registry.

Port of hdr_luminance.h: AnyXboxX_NormalizeHdrLuminance replaces the
incoherent or missing luminances of a display with the DXVK fallbacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The task queue object of victory-hle left slots 27, 28 and 30
(XThreadSetTimeSensitive, XThreadVerifyNotTimeSensitive,
XThreadIsTimeSensitive) unwritten, so titles got E_NOTIMPL. The mark is
kept per thread, as the C++ runtime does; a test checks that another
thread does not see it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The task queue object (XTaskQueue, XAsync, XThread: provider and interface
073B7DCB) is VIctory's xasync object, reused as is instead of being ported
from the libHttpClient task module. The other served objects are still
built empty (E_NOTIMPL, logged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of user_interface.cpp: one offline profile (XUID 0x0009000000A11B0B,
local id 1, always signed in, adult, every privilege), gamertag from
ANYXBOXX_GAMERTAG (default AnyXboxX). Asynchronous calls complete at once
through VIctory's XAsync. The gamer picture (slots 16 to 18) and the Xbox
Live tokens (23 to 28) stay E_NOTIMPL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of system_interface.cpp and game_config.cpp: the Series X console,
sandbox and app device identifiers, the analytics block (Windows.Xbox,
Xbox Series X), the Title ID and the persistent local storage size read
from MicrosoftGame.config (ANYXBOXX_GAME_DIR), the feature check and the
display's timeout deferral. XLaunchUri is refused, as in the C++.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of event_interface.cpp: offline subscriptions get a fresh token
from a shared registry (also used by the connectivity subscription to
come), their callbacks never run; accepting an invite stays E_NOTIMPL.
XErrorReport is logged and passed to the title's callback, set with
XErrorSetCallback; XErrorSetOptions is noted, not applied.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same table and byte-identical SVG as the Python command on packages built
from source (tests/test_rust_traduction_parity.py). The RDNA 2 numbers come
from a table measured by the Python oracle (data/rdna2-coverage.txt, checked
for staleness by the test) until the interpreter is ported in phase 4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same squarified treemap, float for float (Python 3.12's compensated sum
included), so the SVG is byte-identical to the Python one, and the same
badges on stdout (tests/test_rust_carte_parity.py, including synthetic GDK
tables read from a temporary repository).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The static part of rapport.md (inventory, who provides each import) is the
Python report byte for byte, and the summary is printed the same
(tests/test_rust_jour_j_parity.py). The launch steps cannot be ported 1:1:
the analysis runs `anyxboxx rapport`, and the Unicorn launch (decision D2)
and --natif with anyxboxx.exe (decision D4) are reported as not available,
pointing at `anyxboxx run`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same modules, imports and share resolved as the Python bench, row for row,
and the same "imports résolus" total (tests/test_rust_banc_parity.py). The
Python bench also loads and initialises each module in the Unicorn sandbox,
which is dropped (decision D2): those two columns say n/d and the footer
says why, so nothing is reported as run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per component: Rust replacement, parity check, and whether the old code is deleted (lancer_victory.ps1, xcrdapi, kernelx, d3d12_xs, tls, xmem) or why it stays. TLS carrier finding, test numbers and findings. Phase 2 ticked in the plan. English and French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of the platform half of platform_interface.cpp with the windows
crate (0.62.2, as VIctory): XDisplayTryEnableHdrMode reads the primary
output through IDXGIOutput6::GetDesc1 and normalises its luminances;
XNetworkingGetConnectivityHint asks Network List Manager for the level
and the default route's interface for its IANA type. The connectivity
subscription reuses the shared offline registry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of the export part of frame_counter.cpp: AnyXboxX_CreateDXGIFactory,
_CreateDXGIFactory1 and _CreateDXGIFactory2 create the factory, then
patch its swap-chain creation and each swap chain's Present and Present1
so every frame is timed. Once a second the window is reported: CSV line
(ANYXBOXX_FPS_CSV), journal, and the game window title (ANYXBOXX_FPS=1).
The export table now equals the C++ DLL's 17 names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of gamer_picture.cpp: a generated RGB PNG (stored zlib blocks,
CRC-32 per chunk) of the requested XUserGamerPictureSize (64, 208, 424,
1080 pixels); an unknown size is E_INVALIDARG. The async calls complete
through VIctory's XAsync, as the other XUser calls do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under Proton there is no cargo, so `anyxboxx run` stopped at "cannot start
cargo". `--victory-exe <path>` (alias `--VictoryExe`) runs a victory.exe
cross-built on the Linux side (`--target x86_64-pc-windows-msvc`) and skips
the build; the repository is then not needed. Without the option nothing
changes: the repository is located and VIctory is built with cargo.

`Victory::build_command` returns `None` for a prebuilt exe; the graphical
launcher skips the build step in that case and otherwise behaves as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Native Linux builds are not supported (VIctory only builds for Windows);
cross-build both workspaces with `--target x86_64-pc-windows-msvc`.
kernelx and d3d12_xs still need MSVC's lib.exe for their forwarder .exp.
Launch through Proton's wine with `anyxboxx.exe run --victory-exe`, with
VKD3D_CONFIG=descriptor_heap and, for the linux-amd values, --no-tuned-settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pull requests into rust/full got no CI: the workflow only ran for pull
requests into main. rust/full is the integration branch of the move to
Rust (#211) and takes contributors' pull requests until it is merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a clean build the bin folder does not exist yet, and file(COPY_FILE)
does not create folders, so the copy of xcrdapi.dll failed (CI run
45685280325). Create the folder first.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
On a fresh build tree the rust_dlls target can run before any C++ target
has made runtime/build/bin, and file(COPY_FILE) does not create the folder:
"failed to copy ... because: No such file or directory (output)". Seen on
the first CI run of a pull request into rust/full; local trees that were
built before never hit it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	runtime/rust_dlls.cmake
Port of save_store.cpp and save_interface.cpp: containers and blobs on
the PC's disk (<root>\<TitleId>\saves\<configuration>\<XUID>\...), names
encoded so they cannot leave their folder, the 256 MB simulated quota,
atomic blob writes, updates applied at submit, and XGameSaveFiles
folders. Methods 3 to 32 of gdk_api_table.inc are written; asynchronous
calls complete through VIctory's XAsync.

Tests: encoding round trips, size and quota checks, blob and container
listing, deletion, a write and read round trip through the handles, the
method slot table, and the blob buffer layout (52 tests in the crate).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of local_storage_interface.cpp and store_interface.cpp. Local
storage is one folder per game under the save root, with the declared
size from MicrosoftGame.config (512 MB by default) and granted space
requests. The store is offline: a local, complete game licence, empty
product queries, E_GAMESTORE_NETWORK_ERROR for purchase, store windows
and downloads, and a licence-change subscription that never fires.
Other store methods answer E_NOTIMPL through the object table.

The task queue needs no change: VIctory's xasync object, served as
TaskQueueInterface, already serves the XThread methods.

Handles now share one magic-word module (handle.rs) with the save store.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
New crate anyxboxx-rdna2-ref: Rust port of emu/rdna2_exec.py for the
scalar families (SOP1, SOP2, SOPC, SOPK, SOPP) and the branches, with
the decoder of emu/rdna2.py and the mnemonic table generated from
emu/rdna2_ops.py by tools/rdna2_ref_tables.py. Vector, memory, image
and graphics families refuse with an untranslated error that names the
instruction, as the Python does.

Parity: tests/test_rdna2_ref_parity.py runs the same programs through
the Python model and the binary, and compares the final state line by
line: fixed programs, a literal operand, the generated mnemonic table,
and 300 seeded random scalar programs in wave32 and wave64 (299 run to
completion).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
graphics_blocks_get_their_own_region_flagged_by_the_query failed now and
then: a region freed by one test was given to another test running at the
same time, so the freed block still answered MEM_COMMIT. The tests that
allocate or query now take turns on one lock. Fifteen runs of the xmem
tests pass after the change (before: one failure in two workspace runs).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Port of the VECTOR table of emu/rdna2_exec_ops.py for the VOP1 and VOP2
encodings, with the VOP2 carry chain (v_add/sub/subrev_co_ci_u32),
v_readfirstlane_b32 and the no-op names. The float operations follow the
model's exception paths (ValueError gives the canonical NaN), its min/max
NaN ordering and its fused multiply-add rounded to odd.

SDWA and DPP words are refused as untranslated: the Python executes them
through rdna2_exec_ext, so that is a known parity gap.

Parity: the generator now covers VOP1 and VOP2 and special float literals
(NaN, infinities, signed zeros, subnormals). Five parity tests pass, 300
random programs across all scalar and vector families in wave32 and wave64.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of emu/rdna2_exec_ext.py: VOP1 and VOP2 words whose source code is
SDWA (0xF9), DPP16 (0xFA) or DPP8 (0xE9, 0xEA) take their operand
selection, negation, output modifiers and lane permutation from the
extension word, then run the same operation as the plain encoding.
Carry-chain and table-less names with an extension word are refused, as
the Python does. VOPC with an extension word is still refused.

Parity: the generator emits extension words (about 125 instructions in
the 300 seeded programs, 80 programs run to completion). Branches now
land on instruction starts, so a jump cannot decode data as a memory
instruction (outside the model).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
feat: anyxboxx run --victory-exe runs a prebuilt VIctory under Proton
Port of VECTOR_COMPARE and COMPARE64 (emu/rdna2_exec_ops.py,
emu/rdna2_exec_cmp64.py): v_cmp and v_cmpx for f32, u32, i32, f64, u64
and i64 (test names checked against the model's float and integer tests),
and v_cmp_class_f32/f64 with the IEEE class mask. 64-bit sources are
register pairs or inline constants and refuse a literal, as the Python
does. SDWA and DPP forms of VOPC are still refused.

Parity: the 300 seeded programs now contain about 200 VOPC instructions;
all five parity tests pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
xgameruntime: save store, GameSave, local storage, offline store ported;
package_interface.cpp still C++. RDNA 2: anyxboxx-rdna2-ref covers the
decoder, scalar, VOP1/VOP2 (SDWA and DPP) and VOPC; VOP3/VOP3P, memory,
images and graphics still Python. Findings: the CI fix for the Rust DLL
copy (7bc532ba), the xmem test serialization (7b69e6fb), and the parity
generator's branch placement. Both languages updated together.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of the VECTOR3 table of emu/rdna2_exec_vop3.py: the VOP3 instructions
the model has of its own (float fma, mad, legacy fma, min3/max3/med3,
ldexp, the v_cube family, bitfields, byte permute, the integer 3-operand
and SAD/LERP families, 24-bit multiplies). Input abs and neg apply to
the float ones, clamp and omod to the float results, as in the model.
med3 follows CPython's sorted() middle element, NaN included.

VOP3 words are read as 64-bit values; the third word is the literal when a
source is the literal code. The VOP3 encodings of VOP1, VOP2 and VOPC
(opcodes below 0x200), carry, 64-bit multiply, lane operations, f64,
divide, SAD and movrel are still refused.

Parity: about 190 VOP3 instructions in the 300 seeded programs; the five
parity tests pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of emu/rdna2_exec_sad.py: v_msad_u8 (masked byte SAD plus an
accumulator), v_qsad_pk_u16_u8, v_mqsad_pk_u16_u8 (four 32-bit windows of
the 64-bit S0, packed 16-bit results) and v_mqsad_u32_u8 (128-bit S2 and
D in four VGPRs). The VOP3 modifiers and literal or inline-float 64-bit
sources are refused, as the Python does.

Parity: the generator now includes these instructions, biased toward
unmodified encodings so the executed path is covered; the five parity
tests pass on 300 seeded programs.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
VOP3 encodings of the VOP1 and VOP2 operations (input abs and neg on the
float ones, clamp and omod on the float results), of the VOPC compares
(32-bit, writing EXEC or the SGPR named by vdst), the VOP3b carry forms
(v_add/sub/subrev_co_u32 and their _ci_ variants), the lane operations
(readfirstlane, readlane, writelane, mbcnt lo and hi) and the 64-bit
multiply-add (v_mad_u64_u32, v_mad_i64_i32, the signed form refusing a
non-null carry SGPR as the Python does). The dispatch follows the order of
the Python execute. Still refused: the 64-bit compares, f64 operations,
the divide and movrel helpers.

Parity: the generator emits these forms with destinations kept in range
for the model; about 175 VOP3 instructions in the 300 seeded programs
(267 programs run to completion); the five parity tests pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Port of emu/rdna2_exec_div.py: v_div_scale, v_div_fmas and v_div_fixup for
f32 and f64. The model rounds exact rationals; here they are big integers
from the num-bigint crate (pure Rust, MIT or Apache-2.0), added to
crates/anyxboxx-rdna2-ref only and pinned in Cargo.lock. The rationals are
not reduced, which does not change any result of the rounding. The f64
branch the Python refuses (1/S1 denormal, pseudo-code inconsistent) stays
refused, and clamp/omod too.

Parity: a dedicated test runs 200 division instructions on special and random
operand patterns (SGPR operands and f64 pairs) against the Python model, and
the generator includes the helpers as well; the parity tests pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
The VOP3 forms of the 64-bit compares (v_cmp and v_cmpx of f64, u64, i64) and
of v_cmp_class_f32/f64: any source codes (register pairs, SGPR pairs or inline
constants; a literal is refused as the Python does), the model's input
modifiers on the float operands (the class test reads its mask unmodified),
and the destination SGPR named by vdst, or EXEC for v_cmpx. The VOP3 dispatch
runs them before the 32-bit compare forms, as the Python does.

Parity: about 55 of these instructions in the 300 seeded programs; the parity
tests pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Port of emu/rdna2_exec_wide.py: the double-precision operations (conversions
to and from 32-bit ints and floats, rounding to integer with the sign of
zero kept and NaN quieted, fract, reciprocal, reciprocal and square root,
frexp, add, mul, min and max that ignore one NaN, fma, ldexp) and the 64-bit
shifts, for the VOP1 encodings and the VOP3 encodings. Input abs and neg act
on float sources, clamp and omod on float results. The extension-word forms
of these operations are refused before any lane, as the Python does; a
literal on a 64-bit source is refused.

Parity: the generator covers the operations in both encodings, and a
dedicated test runs 200 instructions on SGPR pairs of curated doubles
(infinities, NaNs, signed zeros, subnormals). v_fma_f64 stays out of the
generic generator because Python raises OverflowError on large products.
The parity tests pass. ldexp moves to the shared float module.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Port of emu/rdna2_exec_movrel.py: v_movrels_b32, v_movreld_b32,
v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32 (VOP1 and
VOP3 encodings), and the scalar s_movrels and s_movreld forms (32 and 64
bits, _2 forms included). The index is the register number plus M0 (M0[9:0]
for the source and M0[25:16] for the destination of the _2 forms and
v_swaprel). Indexed sources that are not registers, out-of-range indices
and odd 64-bit indices are refused. The VOP3 forms refuse the modifiers and
the VOP1 forms refuse the extension words, before any lane, as the Python
does.

Parity: the generator emits the forms with indexed sources in range and M0
randomized; the parity tests pass (27 movrel instructions in the 300 seeded
programs, several refused on both sides).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Port of emu/rdna2_exec_dot.py: v_dot2_i32_i16, v_dot2_u32_u16,
v_dot4_i32_i8, v_dot4_u32_u8, v_dot8_i32_i4 and v_dot8_u32_u4. The result is
S2 plus the sum of the element products over 32 bits, with the element width
and signedness of each operation. Only the default form runs (op_sel 0,
op_sel_hi all ones, no neg_lo, neg_hi or clamp); the other forms are refused,
naming the modifier. The other VOP3P instructions are not executed yet.

Parity: the generator emits dot products in the default form most of the
time; 165 VOP3P instructions in the 300 seeded programs, the parity tests
pass.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
RDNA 2 reference crate: VOP3 covered (native table, older encodings, carry,
lanes, 64-bit multiply, SAD, division with num-bigint, 64-bit compares, f64,
movrel), VOP3P dot products. Still Python: the other VOP3P operations, the
16-bit operand-select forms, SDWA and DPP on VOPC, memory, images, graphics.
Checks: 48 crate tests, 7 parity tests. Both languages updated together.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
The Python model's _fma (emu/rdna2_exec_wide.py) converts an exact result
with float(), which raises OverflowError past the double range instead of
returning infinity as IEEE fma does. Recorded in both languages; the Rust
port returns infinity, and the parity fuzz covers v_fma_f64 separately.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Port of the Memory class of emu/rdna2_exec_memory.py: 4 KiB pages created
by the first write, zeros for pages never written, and the V# buffer
descriptor helper. The wave carries its memory; no instruction reads it yet.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Ports the SMEM family of emu/rdna2_exec_memory.py and emu/rdna2_exec_smem.py:
s_load and s_buffer_load (dword to dwordx16, V# bounds with zeros outside),
s_store, s_atomic and s_buffer_atomic (integer kinds, _x2 forms, GLC returns
the old value), s_memtime and the cache-control no-ops. The integer atomic
table lives in atomic.rs.

The CLI gains `mem ADDR W...` to seed global memory, and its output ends with
one `page ADDR OFF:HEX ...` line per created 4 KiB page. The parity test seeds
the same pages on the Python side and checks each SMEM case runs (no refusal).

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Both languages: scalar memory and integer atomics are in Rust, the test
counts are 55 (crate) and 8 (parity), and the remaining Python memory list is
DS, buffers, FLAT, GLOBAL and SCRATCH. The crate doc says the same.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Ports ds_read and ds_write (b32 to b128, and u8, i8, u16, i16, b8, b16 with
sign extension for the signed kinds), the read2 and write2 forms with their
st64 scaling, and ds_nop. Each wave has its own 64 KiB LDS in Wave. The
atomics, the _d16 halves and the lane operations (ds_swizzle, ds_permute,
ds_bpermute) still refuse as untranslated. An access past the end of the LDS
is refused, where the Python slices it and changes the array's length.

Parity: tests/test_rdna2_ref_parity.py runs four DS programs (wave32 and
wave64) through both models, with a check that each one runs on the Python
side. The 32-bit word helper le_words moves to memory.rs.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Simple forms (add, sub, and, or, xor, min, max on u32 and i32), extended
forms (rsub, inc, dec, mskor, cmpst, wrxchg, wrap, and the 64-bit types),
the _rtn variants, and ds_wrxchg2[st64]_rtn_b32|b64. Float atomics and
min/max on b32/b64 are refused, as are wrxchg and wrap without _rtn and
i32 outside the simple forms. Parity cases added to
tests/test_rdna2_ref_parity.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The _d16 forms of the DS reads (u8, i8, u16, each with its _hi form) and
of the high-half writes (b8, b16). The lane exchanges ds_swizzle_b32
(quad permute and bit-mask modes; ROTATE, FFT and reserved offsets are
refused), ds_permute_b32 and ds_bpermute_b32, within groups of 32 lanes.
Parity cases added to tests/test_rdna2_ref_parity.py, wave32 and wave64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Loads (dword, byte, short, dwordx2 to dwordx16 and their signed forms),
stores and atomics (32 and 64 bits, cmpswap with its compared value) on
the 64-bit VGPR address of FLAT and SCRATCH, and on the SGPR pair plus
32-bit VGPR offset of GLOBAL with SADDR. The 12-bit OFFSET is signed. The
access code is shared with MUBUF through vmem.rs. Float atomics and the
addtid forms are refused. Parity cases added to
tests/test_rdna2_ref_parity.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Buffer loads, stores and atomics through the V# descriptor at SRSRC
(base, stride, records, as memory::descriptor reads it), with OFFEN,
IDXEN, GLC and SOFFSET. A stride selects the index test, no stride the
byte-range test; an access outside the records reads zeros or does
nothing. The accesses are shared with FLAT through vmem.rs. Parity cases
added to tests/test_rdna2_ref_parity.py (stride 0, stride 16 in wave64).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of emu/rdna2_buffer_format.py and emu/rdna2_exec_format.py:
buffer_load/store_format_* (format from the V#, DST_SEL) and
tbuffer_load/store_format_* (format from the instruction, V# FORMAT
INVALID disables the access). UNORM/SNORM loads round the exact quotient
to the nearest float32 with integer arithmetic; FLOAT16 widens exactly;
stores take UINT, SINT and 32-bit FLOAT only, with the Python's
saturation. The format table is generated by tools/rdna2_ref_tables.py
(format_table.rs) from gfx10_formats.json and rdna2_buffer_format.FORMATS.

Parity: MUBUF and MTBUF loads over 16 + 9 formats with DST_SEL variants
and out-of-records lanes in wave32 and wave64, a strided load, stores
with saturation, and 16 refused cases (invalid format, store
restrictions, DST_SEL, lds, tfe, _d16, misalignment, swizzle, add_tid).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Port of emu/rdna2_image.py and emu/rdna2_exec_image.py: image_load[_mip],
image_store[_mip], image_get_resinfo, image_sample[_lz|_l][_o],
image_sample_c[_lz|_l][_o] and image_gather4[_lz|_l][_o] on 2D linear
images of one mip level in the six formats the Python takes, point or
bilinear filtering, wrap, mirror, clamp-to-edge, mirror-once and border
addressing, NSA address words. Every filtering step is a float32
operation, as the Python rounds each one; what the Python refuses (other
image instructions, dims, r128/tfe/lwe/a16/d16, multi-channel gather4,
other formats, mip levels, addressing modes, anisotropy, register border
colours) becomes Error::Untranslated.

Parity: 8 image setups (6 formats, swizzles) in wave32 and wave64, each
running 18 loads, samples, compares, gathers and stores over per-lane
coordinates with NaN, infinities and offsets, and 15 refused cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
English and French together: the reference interpreter now also runs the
LDS, FLAT/GLOBAL/SCRATCH, MUBUF, the typed buffer formats (MUBUF and
MTBUF) and the 2D MIMG instructions; the "Still Python" list keeps the
rest. The typed-format rules are marked as coming from Leonida's
gfx1035/gfx1036 (and RX 6700) measurements, taken down after a DMCA
notice, awaiting an AMD ISA or LLVM citation or our own measurement.
Measured counts: cargo test 95 passed, parity 18 passed and 1 known
failure (v_sqrt_f64 NaN sign) of 19.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
v_sqrt_f64 and v_rsq_f64 of a negative input returned f64::NAN, whose
sign bit is not fixed by the language; on x86 it came out as the negative
default NaN (0xFFF8...), while the Python model's math.nan is 0x7FF8....
The two arms now return the canonical bits directly, so LLVM cannot fold
the NaN through the select. The NaN in a fract of an infinity uses the
same constant. This fixes test_wide_operations_match_the_python_model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The Python model refuses every _d16 form of the typed accesses
(buffer_load/store_format_d16_*, the _d16_hi_x forms, tbuffer_*_format_d16_*)
and the d16 bit of the MIMG instructions; the Rust interpreter already refuses
the same. New parity case: all 28 such instructions, wave32 and wave64, give
"error untranslated" in both models. Nothing to port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of the float kinds of `operation` in emu/rdna2_exec_atomic.py into a new
atomic_float.rs: fcmpswap, fmin and fmax (32-bit and _x2) for FLAT and GLOBAL
(and the buffer_ names the Python pattern accepts), and fadd, fmin, fmax and
fcmpst (f32 and f64, with and without _rtn) for the LDS. atomic::apply now
tries the integer kinds then the float ones; vmem and ds_atomic use it.

Rules, as the Python defines them: float equality for the compare-swaps
(+0 = -0, NaN never equal), a lone NaN loses in fmin and fmax, two NaNs or a tie
keep the old value, fadd is the f64 sum rounded once to the width.

Unverified assumptions carried from the Python: the fmin/fmax NaN rule comes
from the V_MIN/V_MAX description (the Python says so: to confirm on hardware).
The NaN produced by fadd is the one the Python's x86-64 arithmetic gives
(first NaN operand, old value first, quieted; default NaN 0xFFC00000 or
0xFFF8000000000000 for inf + -inf), measured on the model, not documented for
RDNA 2; the Rust writes that rule out explicitly.

Parity: GLOBAL and FLAT float atomics (with and without GLC) and the 14 LDS
float atomics on signed zeros, quiet and signalling NaNs, infinities and
denormals, wave32 and wave64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The Python model's VOP3P table holds only the integer dot products, in their
default form; every other VOP3P instruction (v_pk_*, v_dot2_f32_f16,
v_fma_mix*) and the dot products with op_sel, op_sel_hi cleared, neg_lo,
neg_hi or clamp are refused, and the Rust interpreter refuses the same.
New parity case: those 29 forms refused, one plain dot product executed,
wave32 and wave64. Nothing to port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The Python model has one 16-bit-result operation, v_sat_pk_u8_i16, and refuses
its VOP3 form with op_sel or clamp; elsewhere op_sel is not read (32-bit
results). The Rust interpreter already does the same. New parity case: the op_sel
bits and clamp on v_sat_pk_u8_i16 refused, its plain form and op_sel on
v_add_nc_u32, v_fma_f32 and v_med3_i32 executed with op_sel ignored, wave32 and
wave64. Nothing to port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of the VOPC branch of `_exec_sdwa` and of the VOPC refusals of `execute`
in emu/rdna2_exec_ext.py, in a new ext_compare.rs:
- SDWA on the 32-bit compares (v_cmp[x]_<test>_f32/u32/i32): each source read
  through its byte or word selection, sign extension for integer compares, abs
  and neg for float ones, source 0 or 1 from an SGPR when bit 23 or 31 is set;
  the mask goes to EXEC for v_cmpx, to the SDST of bits 8-14 when SD (bit 15)
  is set, else to VCC.
- DPP16 and DPP8 compares are refused, named as in the Python.
- The 64-bit and class compares keep the Python's dispatch order (before its
  SDWA/DPP check): the extension code is read as a plain source, which fails on
  the first active lane and writes an empty mask when EXEC is empty.

Parity: 200 seeded programs of SDWA, DPP and 64-bit compares with extension
codes on per-lane integer and float values, wave32 and wave64, some with an
empty EXEC. The generator keeps SDST off s127 in wave64, where the Python
model would index s128 (an IndexError, not a refusal).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The float atomics (FLAT, GLOBAL, LDS) and SDWA on VOPC move to the Rust list,
with the two float-atomic rules that are unverified assumptions carried from
the Python. The VOP3P operations beyond the dot products, the VOP3 16-bit
op_sel forms, DPP on VOPC and the typed and image _d16 forms are recorded as
refused by both models (parity-tested), not as Python-only. Measured counts:
cargo test -p anyxboxx-rdna2-ref 107 passed; tests/test_rdna2_ref_parity.py
24 passed of 24 (the wide test passes since ea9fee97). English and French
together; the Leonida-sourced typed-format note is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
feat: native launcher ported to Rust (anyxboxx-native-launcher)
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Port of _export in emu/rdna2_exec_graphics.py: each active lane records
its four values under the target (disabled channels record 0, a later
export replaces the lane's values, every target is kept), and COMPR is
refused before any lane, as in the Python. The CLI prints the exports
as `exp TARGET LANE X Y Z W`; the parity test renders the Python's
wave.exports the same way. Parity: fixed cases in wave32 and wave64
(partial and empty EXEC, null and invalid targets, done/vm) and 120
seeded random programs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of _interpolate in emu/rdna2_exec_graphics.py: v_interp_p1_f32
(P10 x S + P0), v_interp_p2_f32 (P20 x S + D) and v_interp_mov_f32
(P10, P20, P0, or 0 for another source), the product and the sum each
rounded to single precision. P0, P10 and P20 are read from the
PARAMETERS area of emu/rdna2_graphics.py, for the wave's primitive or
the lane's own. Attributes past param7 are refused before any lane, and
VINTRP opcode 3 and the VOP3 forms stay refused, as in the Python.

NaN results follow the Python's x86-64 arithmetic (left NaN operand
first, quieted; default NaN with its sign set for an invalid
operation), written out because Rust may swap commutative operands: a
property of the model's host, kept as an unverified assumption.

The CLI takes `primitive N` and `primitives L:P ...`; the parity
helpers pass them to both models. Parity: fixed cases in wave32 and
wave64 (partial and empty EXEC, per-lane primitives, refusals) and 150
seeded random programs with NaN, infinite and subnormal parameters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Port of emu/rdna2_exec_pc.py: s_getpc_b64, s_setpc_b64, s_swappc_b64
(SOP1) and s_call_b64 (SOPK), dispatched after the branches as in the
Python. Addresses are byte offsets from PROGRAM_BASE (0). Refused as in
the Python: an odd destination pair, an S0 that is odd or past the
SGPRs, a target outside the program or off a word; the target is
checked before D is written. Parity: subroutines through s_swappc_b64
and s_call_b64 with s_setpc_b64 returns, s_getpc_b64 with a literal and
into NULL, M0 and EXEC, s_setpc_b64 on NULL, and every refusal, in
wave32 and wave64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
buffer_gl0_inv and buffer_gl1_inv invalidate caches the model does not
have: they do nothing, whatever their fields, as CACHE_CONTROL in
emu/rdna2_exec_memory.py (the Rust refused them). Parity: both, with
random fields, between a buffer store and a load, in wave32 and wave64.

With this, a sweep of every encoding the Python executes (zero
operands, wave32 and wave64) finds no instruction the Python runs and
the Rust refuses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
EXP, VINTRP, the program counter instructions and the MUBUF cache
controls are in the Rust reference interpreter; an encoding sweep finds
no instruction the Python runs and the Rust refuses. Counts: cargo test
rdna2-ref 122 passed, parity 28 of 28. Records the VINTRP NaN
assumption and a Python-side bug (VOP3 madmk/madak/fmamk/fmaak without
a literal raise TypeError). English and French together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
The GPU runner parity tests bring the suite to 1,302 tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
feat: GPU runner ported to Rust (anyxboxx_gpu_run.exe)
Dusk gradient background, translucent cards, pill tabs and a pink-to-orange progress bar (theme.rs, WCAG AA contrast tested). Splash screen shown for 2 s and while a job runs; its picture is read at run time from ANYXBOXX_LAUNCHER_SPLASH or %LOCALAPPDATA%\AnyXboxX\launcher\splash.png and is never committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Hero page with PLAY button and status chips, left navigation, animated pages and buttons, toasts, console drawer with coloured levels, launch screen. Launch options (display size, window mode, keyboard, preset, log level, warm shaders) saved in settings.toml; native folder and xg_xs.dll pickers, drag and drop, game folder auto-detection. Children start without a console window. VIctory: VICTORY_KEYBOARD maps the stand-in pad by physical key position, VICTORY_WINDOW_MODE=borderless.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
The folder check no longer hashes 130 GB: it reads only PE and RPF7 headers, with a 20 s timeout and visible errors (toast and console) for any failure or panic. The SHA-256 manifest is a separate optional job with per-file and total progress, speed, ETA, cancel, and a cache keyed by name, size and mtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
shaders.rpf starts with the magic of an RPF9 archive, not RPF7, so the quick check reported the real folder as damaged. RPF9 is checked on its magic and a whole header only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Conflicts resolved:
- third_party/victory: main's Neptune tree taken wholesale; the old launcher
  keyboard and borderless patches are re-applied in a follow-up commit.
- tools/lancer_victory.ps1: kept deleted (replaced by `anyxboxx run`); its
  main changes are ported in a follow-up commit.
- README, THIRD_PARTY, AGENTS, docs/*: main's text taken; references to the
  script and to rust/Cargo.toml are updated in a follow-up commit.
- tests/test_lanceur_victory.py: rust/full's version kept (it tests the
  settings of `anyxboxx run`); expectations updated in a follow-up commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
- victory-hle: keymap module (VICTORY_KEYBOARD=scancode|qwerty|azerty|qwertz);
  the stand-in pad's letter keys resolve through it (ZQSD works on AZERTY).
- victory-gpu: VICTORY_WINDOW_MODE=borderless makes a frameless screen-size window.

Both carry their tests (keymap: 8, window mode: 1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Taking main's victory tree wholesale dropped two rust/full changes to
victory-hle: EraFields (xmem.rs, used by anyxboxx-xmem) and the xasync
additions. Both are restored by a three-way merge against the merge base.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
- anyxboxx run = main's tools/lancer_victory.ps1: release build by default,
  39-variable Neptune set, -Quality, --override, --auto-a, --frametime-dump,
  --diag/--dred, --warm (game archives only), --precompile (warm of shaders.rpf,
  exe and DLLs). tests/fixtures/lancer_victory_neptune.ps1 is the golden copy;
  tests check the Rust tables and the environment against it.
- Launcher: profiles and options follow the same sets (Fast = measured set,
  Quality = -Quality set); options for the stats overlay (F10), auto-A and the
  frame-time CSV; the game starts detached, its output in
  %LOCALAPPDATA%\AnyXboxX\logs\game-<time>.log, and the launcher closes once the
  game is up unless "Keep the launcher open after launch" is on.
- Smart warm: a marker (warm-state.txt) holds the fingerprint of victory.exe,
  the VICTORY_* environment and the archives; PLAY warms automatically when it
  is missing or stale; "Always re-warm before launch" forces it; "Warm now" is
  the shader page button.
- Docs: rust/full status and README count (1700+) follow the merged tree; the
  rdna2-ref parity tests that fail after the merge are listed as open items.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
- Full-window launch screen while PLAY builds VIctory or warms the shaders:
  the splash covers the window with a slow Ken Burns drift and a dark
  gradient, the stages (Building VIctory, Preloading shaders, Starting the
  game), a large bar fed by VIctory's progress lines, elapsed time and time
  left (launch_progress.rs, tested), and Cancel, which kills the running
  step (job.rs, Event::Cancelled, tested).
- Design tokens (tokens.rs): 8-point spacing scale, type scale, radii and
  motion timings (150-250 ms); hand-painted controls (widgets.rs) with hover
  glow, press scale-down and keyboard focus rings.
- Cinematic Home hero: the picture covers the hero with a slow zoom and a
  pointer parallax under a rounded left-to-right shade (cover.rs, shade.rs),
  glowing PLAY that pulses while launching, status chips with icons and
  tooltips.
- States: loading spinner, empty game folder call to action, red error card
  with Copy log, success card; toasts slide in from the right.
- Contrast: text over the picture overlay is tested in linear light (the
  renderer's blending), so the overlay is darker; new surfaces tested for AA.
- About lines with the version and the git commit (build.rs).
- --page <name> opens a page; --preview-launch (debug builds only) shows the
  launch screen without running anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Pictures come from ANYXBOXX_LAUNCHER_SPLASH (file or folder), else the splash folder
under LOCALAPPDATA, else splash.png. They rotate every 6 s with a cross-fade, each with
its own Ken Burns drift, decoded lazily on a thread with at most two textures alive and
shrunk to 2560 px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
docs/launcher.md and docs/fr/lanceur.md: requirements, clone of rust/full,
prebuilt or source launcher, how it finds the repository (ANYXBOXX_REPO),
first start, options, files it writes, troubleshooting. Linked from
rust-full-status and running-gta6 (both languages). Also fixes the logs
path that had lost its backslashes and the splash description (folder
slideshow).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
AGENTS.md: keep rust/full's VIctory row (anyxboxx run), drop the
third_party/leonida row as main did; the layout now names crates/ instead
of the removed rust/, says what runtime/ still builds in C++, and the setup
runs cargo before CMake (rust_dlls.cmake stops a build whose Rust DLLs are
missing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The GPU runner is crates/anyxboxx-gpu-run; runtime/gpu_runner is only the
C++ parity oracle. The French page had lost its accents (written as "?")
in the xgameruntime update, and both pages a typographic apostrophe and
an arrow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The 🦀 line no longer says "not yet in main": it names anyxboxx run and the
graphical launcher (install guide, launcher-v0.1.0 release), the runtime
DLLs already shipped from Rust, the 36 RDNA 2 parity tests, and that the
shipped xgameruntime.dll is still the C++ one. Links point to main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
- "The game is not playable" was wrong: GTA VI 1.0.2.1 starts, plays its
  cutscenes and reaches the world at about 14 fps (Series X mode, RTX 4070
  SUPER, measured 2026-11-25). Same fix in all 9 languages and in
  AGENTS.md ("does not run commercial games", "blocked on a legally usable
  executable").
- Removed from the READMEs the pictures of the toy demo, the SimpleTriangle
  and testgdk fps curves and capture, the DLL bench and the Python module
  diagram. The files used only by the READMEs are deleted; the progress map
  and translation chart stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
#309 added the 16 image_atomic_* instructions to the Python model; the
table anyxboxx traduction embeds is regenerated with
`python tests/test_rust_traduction_parity.py`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
tests.yml: keep rust/full's job (cargo workspace before CMake) and take
#348's changes that apply to it: pytest no longer waits for lint, and runs
with -n auto. #348's C++ runtime cache is left out: here CMake copies the
Rust DLLs from target/release, so it must run after cargo every time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The suite now collects 1,806 tests; the built-in RDNA 2 coverage table of
anyxboxx traduction is regenerated for #302's VOP3P f16 instructions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The Rust interpreter refused the VOP3P forms that the Python model
gained in #302. They now run bit for bit like the model:

- v_pk_fma/add/mul/min/max_f16 with op_sel, op_sel_hi, neg_lo, neg_hi
  and clamp, rounding each half once to binary16 (ties to even);
- v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16, refusing op_sel on
  an f32 source;
- v_dot2_f32_f16, refusing op_sel[2] and neg_hi[2];
- v_pk_fmac_f16 in VOP2 (SDWA and DPP refused) and VOP3 (clamp only).

half.rs holds the binary16 conversions; pkf16.rs and pkf16_mix.rs hold
the instructions. Parity tests cover the forms and 200 seeded programs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The pytest job of #351 spent over 15 minutes compiling the root workspace
with no cache (cancelled at 15m41 by the next push).

- pytest builds only what it launches: the workspace without the
  graphical launcher (egui, wgpu, winit: the largest dependency tree),
  and no longer runs cargo test.
- New job "cargo test", in parallel: the Rust tests of the whole
  workspace, launcher included. Not a required check.
- CI compile settings: no debug info, opt-level 1, no incremental.
- rust-cache also saves from pull requests, one key per job, so a second
  push to a PR (and every PR after main saves) restores the dependencies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:31:15 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 11:05 UTC · original · edited 2026-11-26 11:09 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T11:09:16.797985Z d2248c2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 11:05 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#issuecomment-7190263359) · edited 2026-11-26 11:09 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d2248c20072173448c6b3889d391907ce423ca20","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T11:09:16.797985Z">2026-11-26T11:09:16.797985Z</relative-time> | `d2248c2` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 11:09 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2248c2007

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 11:09 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#pullrequestreview-6073079860) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `d2248c2007` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
@ -0,0 +355,4 @@
};
self.notice = Some(match cache::clean_cache(&dir) {
Ok(cache::CleanOutcome::Removed) => format!("Shader cache removed: {}", dir.display()),
Ok(cache::CleanOutcome::NothingToClean) => "No shader cache to remove.".to_string(),
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 11:09 UTC · original

P2 Badge Invalidate the warm marker when cleaning the shader cache

After a successful warm, choosing “Clean shader cache” deletes the cache but leaves %LOCALAPPDATA%\AnyXboxX\launcher\warm-state.txt intact. On the next launch with unchanged settings, warm_check() produces the same fingerprint and skips warming, even though the cache is now empty. Invalidate the marker after successful removal (and when the cache is already absent), so the normal Play flow rebuilds the cache rather than starting cold.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 11:09 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#discussion_r4707494362) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Invalidate the warm marker when cleaning the shader cache** After a successful warm, choosing “Clean shader cache” deletes the cache but leaves `%LOCALAPPDATA%\AnyXboxX\launcher\warm-state.txt` intact. On the next launch with unchanged settings, `warm_check()` produces the same fingerprint and skips warming, even though the cache is now empty. Invalidate the marker after successful removal (and when the cache is already absent), so the normal Play flow rebuilds the cache rather than starting cold. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -0,0 +91,4 @@
let marker = warm_state::marker_path(std::env::var_os("LOCALAPPDATA").as_deref());
crate::launch::warm_check(
&victory.exe,
&env,
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 11:09 UTC · original

P2 Badge Check the warm fingerprint after building VIctory

When VIctory sources change after a previously warmed launch, this check still reads the old victory.exe, whose fingerprint matches the saved marker. play_steps() consequently omits the warm step, then rebuilds VIctory and immediately launches the new executable against the old cache. The change is only detected on the following launch. Recompute the build identity and warm decision after the build succeeds, and save that post-build fingerprint when warming completes.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 11:09 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#discussion_r4707494372) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Check the warm fingerprint after building VIctory** When VIctory sources change after a previously warmed launch, this check still reads the old `victory.exe`, whose fingerprint matches the saved marker. `play_steps()` consequently omits the warm step, then rebuilds VIctory and immediately launches the new executable against the old cache. The change is only detected on the following launch. Recompute the build identity and warm decision after the build succeeds, and save that post-build fingerprint when warming completes. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Two review findings on #351:
- "Clean shader cache" left warm-state.txt behind, so the next launch
  with the same settings skipped the warm on an empty cache. The marker
  is now deleted with the cache (warm_state::forget_marker).
- The warm decision used the fingerprint of the victory.exe found before
  "Building VIctory"; a rebuild changed the exe but the warm was skipped.
  When a build step runs first, the warm step is listed with a check made
  once the build is over (job::Step::run_if), and the marker is written
  with the fingerprint of that moment.

Tests: job skips a step whose check says no; the warm after a build runs
for a marker of another exe and is skipped for this one's; a forgotten
marker makes the next launch warm. 197 launcher tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-26 11:41 UTC · original
On crates/anyxboxx-launcher/src/app.rs line 358 (outdated):

@@ -0,0 +1,391 @@
+//! The window's state and the actions behind its buttons. Long work (folder checks, VIctory's
+//! translate and game) runs on threads; this module drains their results once per frame.
+
+use std::collections::VecDeque;
+use std::path::PathBuf;
+use std::sync::Arc;
+use std::sync::atomic::AtomicBool;
+use std::sync::mpsc::{self, Receiver};
+use std::time::Instant;
+
+use crate::app_check::ManifestState;
+use crate::app_launch::Banner;
+use crate::cache;
+use crate::host::{self, Adapter, GpuVendor, Host};
+use crate::job::{self, Event, Step};
+use crate::launch;
+use crate::launch_progress::{self, Stage, Tracker};
+use crate::manifest::Outcome;
+use crate::picker::{self, Pick};
+use crate::processes::Tasklist;
+use crate::profile::{Profile, Profiles};
+use crate::progress::{Progress, Summary};
+use crate::session::{self, Settings};
+use crate::setup::{self, Item};
+use crate::splash::Splash;
+use crate::store::{self, Stored};
+use crate::toast::Toasts;
+use crate::verify::Report;
+
+/// Lines kept in the log view.
+const LOG_CAPACITY: usize = 2000;
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum Tab {
+    Home,
+    Setup,
+    Files,
+    Shaders,
+    Play,
+}
+
+/// The game folder check.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum Verify {
+    NotRun,
+    Running,
+    Done(Report),
+    Failed(String),
+}
+
+/// A job running on its thread, whether it is the shader step, its stages and its cancel switch.
+pub struct Running {
+    pub events: Receiver<Event>,
+    pub shaders_only: bool,
+    pub stages: Vec<Stage>,
+    pub cancel: Arc<AtomicBool>,
+}
+
+pub struct App {
+    pub repo: Option<PathBuf>,
+    pub profiles: Profiles,
+    pub host: Host,
+    pub gpu: GpuVendor,
+    pub adapter_name: Option<String>,
+    adapters: Option<Vec<Adapter>>,
+    pub setup: Vec<Item>,
+    pub settings: Settings,
+    pub tab: Tab,
+    pub verify: Verify,
+    pub(crate) verify_rx: Option<Receiver<Result<Report, String>>>,
+    pub(crate) verify_started: Option<std::time::Instant>,
+    /// The optional SHA-256 manifest job; it never gates PLAY.
+    pub manifest: ManifestState,
+    pub(crate) manifest_rx: Option<Receiver<Outcome>>,
+    pub running: Option<Running>,
+    pub log: VecDeque<String>,
+    pub summary: Summary,
+    pub notice: Option<String>,
+    /// Set when the game is up and the launcher may close (see `keep_open_after_launch`).
+    pub close_requested: bool,
+    pub confirm_clean: bool,
+    pub cache_dir: Option<PathBuf>,
+    pub splash: Splash,
+    pub toasts: Toasts,
+    /// The step the running job is on (`Building VIctory`, `Running the game`...).
+    pub step: Option<String>,
+    pub drawer_open: bool,
+    /// Whether the shader cache folder holds something (looked at every couple of seconds).
+    pub cache_ready: bool,
+    pub cache_checked_at: f64,
+    /// When the page on screen was switched to, in egui seconds (for the page transition).
+    pub tab_changed_at: f64,
+    pub shown_tab: Tab,
+    /// Start the game as soon as the folder check passes (PLAY pressed before it ended).
+    pub launch_when_ready: bool,
+    /// The launch screen's model: stage, progress, pace.
+    pub tracker: Tracker,
+    /// The outcome of the last job, shown as a card until dismissed or replaced.
+    pub banner: Option<Banner>,
+    /// Shows the launch screen without running anything (`--preview-launch`, debug builds only).
+    pub preview_launch: bool,
+    pub(crate) clock: Instant,
+    pick_rx: Option<Receiver<(Pick, Option<PathBuf>)>>,
+    settings_path: Option<PathBuf>,
+    last_saved: Stored,
+}
+
+/// The checklist as the machine is now; `adapters` is what DXGI listed (None when it failed).
+fn read_setup(adapters: Option<&[crate::host::Adapter]>) -> Vec<Item> {
+    let system_root = std::env::var_os("SystemRoot").unwrap_or_else(|| "C:\\Windows".into());
+    let program_files = std::env::var_os("ProgramFiles(x86)")
+        .map_or_else(|| PathBuf::from("C:\\Program Files (x86)"), PathBuf::from);
+    let kits = program_files.join("Windows Kits").join("10").join("bin");
+    let facts = setup::probe(
+        &PathBuf::from(system_root),
+        &kits,
+        adapters.map(<[_]>::to_vec),
+    );
+    setup::checklist(&facts)
+}
+
+impl App {
+    /// The window's first state: the setup checklist, the GPU and the host are read now.
+    pub fn new() -> Result<Self, String> {
+        let profiles = Profiles::embedded().map_err(|e| e.to_string())?;
+        let settings_path = store::current_path();
+        let settings = settings_path
+            .as_deref()
+            .and_then(store::load)
+            .map(Stored::into_settings)
+            .unwrap_or_default();
+        let settings_copy = settings.clone();
+        let host = host::detect_host();
+        let adapters = host::enumerate_adapters().ok();
+        let gpu = adapters
+            .as_deref()
+            .map_or(GpuVendor::Unknown, host::vendor_of);
+        let adapter_name = adapters
+            .as_deref()
+            .and_then(host::main_adapter)
+            .map(|a| a.name.clone());
+        let mut app = App {
+            repo: anyxboxx::run::find_repo(None),
+            profiles,
+            host,
+            gpu,
+            adapter_name,
+            setup: read_setup(adapters.as_deref()),
+            adapters,
+            settings,
+            tab: Tab::Home,
+            verify: Verify::NotRun,
+            verify_rx: None,
+            verify_started: None,
+            manifest: ManifestState::NotRun,
+            manifest_rx: None,
+            running: None,
+            log: VecDeque::new(),
+            summary: Summary::default(),
+            notice: None,
+            close_requested: false,
+            confirm_clean: false,
+            cache_dir: cache::current_cache_dir(),
+            splash: Splash::new(),
+            toasts: Toasts::default(),
+            step: None,
+            drawer_open: false,
+            cache_ready: false,
+            cache_checked_at: 0.0,
+            tab_changed_at: 0.0,
+            shown_tab: Tab::Home,
+            last_saved: Stored::from_settings(&settings_copy),
+            launch_when_ready: false,
+            tracker: Tracker::default(),
+            banner: None,
+            preview_launch: false,
+            clock: Instant::now(),
+            pick_rx: None,
+            settings_path,
+        };
+        app.find_game_folder();
+        if app.settings.game_path().is_some() {
+            app.start_verify();
+        }
+        Ok(app)
+    }
+
+    /// Keeps the saved game folder when it still holds the game, else looks for one next to the
+    /// launcher and in its parents.
+    fn find_game_folder(&mut self) {
+        let last = self.settings.game_path();
+        let launcher = picker::launcher_dir();
+        let found = picker::detect(launcher.as_deref(), last.as_deref());
+        if let Some(dir) = found {
+            self.settings.game_dir = dir.display().to_string();
+        }
+    }
+
+    /// Opens the folder dialog on its own thread.
+    pub fn pick_game_folder(&mut self) {
+        self.open_dialog(Pick::GameFolder);
+    }
+
+    /// Opens the file dialog for the xg_xs.dll.
+    pub fn pick_xg_library(&mut self) {
+        self.open_dialog(Pick::XgLibrary);
+    }
+
+    fn open_dialog(&mut self, kind: Pick) {
+        if self.pick_rx.is_some() {
+            return;
+        }
+        let start = match kind {
+            Pick::GameFolder => self.settings.game_path(),
+            Pick::XgLibrary => PathBuf::from(self.settings.xg_dll.trim())
+                .parent()
+                .map(PathBuf::from),
+        };
+        self.pick_rx = Some(picker::open(kind, start));
+    }
+
+    /// Uses `dir` as the game folder when it is one (error toast otherwise), then checks it.
+    pub fn set_game_folder(&mut self, dir: &std::path::Path) {
+        match picker::validate_game_folder(dir) {
+            Ok(()) => {
+                self.settings.game_dir = dir.display().to_string();
+                self.manifest = ManifestState::NotRun;
+                self.notice = Some(format!("Game folder saved: {}", dir.display()));
+                self.start_verify();
+            }
+            Err(reason) => self.notice = Some(format!("Cannot use this folder: {reason}")),
+        }
+    }
+
+    /// Takes the answer of a dialog, if one came.
+    fn poll_dialog(&mut self) {
+        let Some(rx) = &self.pick_rx else {
+            return;
+        };
+        let Ok((kind, chosen)) = rx.try_recv() else {
+            return;
+        };
+        self.pick_rx = None;
+        let Some(path) = chosen else {
+            return;
+        };
+        match kind {
+            Pick::GameFolder => self.set_game_folder(&path),
+            Pick::XgLibrary => self.settings.xg_dll = path.display().to_string(),
+        }
+    }
+
+    /// A folder (or a file of it) dropped on the window becomes the game folder.
+    pub fn handle_drops(&mut self, ctx: &eframe::egui::Context) {
+        let dropped = ctx.input(|i| i.raw.dropped_files.first().and_then(|f| f.path.clone()));
+        if let Some(path) = dropped {
+            self.set_game_folder(&picker::folder_of_drop(&path));
+        }
+    }
+
+    /// The profile for this host and GPU.
+    pub fn profile(&self) -> &Profile {
+        self.profiles.select(self.host, self.gpu)
+    }
+
+    /// Reads the checklist again (after the user installed something).
+    pub fn refresh_setup(&mut self) {
+        self.setup = read_setup(self.adapters.as_deref());
+    }
+
+    /// The repository folder, or an empty path when none was found (the plan is then only shown).
+    pub fn repo_or_empty(&self) -> PathBuf {
+        self.repo.clone().unwrap_or_default()
+    }
+
+    /// Where VIctory keeps saves and data: `VICTORY_DATA_DIR`, else `%LOCALAPPDATA%\victory\data`.
+    pub fn data_dir_label(&self) -> String {
+        let data = std::env::var_os("VICTORY_DATA_DIR")
+            .filter(|v| !v.is_empty())
+            .map(PathBuf::from)
+            .or_else(|| {
+                std::env::var_os("LOCALAPPDATA")
+                    .map(|l| PathBuf::from(l).join("victory").join("data"))
+            });
+        data.map_or("unknown".to_string(), |d| d.display().to_string())
+    }
+
+    pub fn is_busy(&self) -> bool {
+        self.running.is_some() || matches!(self.verify, Verify::Running)
+    }
+
+    /// The last progress report of the translate, for the bar.
+    pub fn progress(&self) -> Option<&Progress> {
+        self.summary.last_progress.as_ref()
+    }
+
+    /// Starts the play steps, or the shader preloading alone; refused while a game runs.
+    pub fn start(&mut self, precompile_only: bool) {
+        if self.is_busy() {
+            return;
+        }
+        if let Err(error) = session::guard(&self.settings, &Tasklist) {
+            self.notice = Some(error.to_string());
+            return;
+        }
+        let profile = self.profile().clone();
+        let Some(repo) = self.repo.clone() else {
+            self.notice = Some(
+                "AnyXboxX folder not found: run the launcher from the repository (target\\release).".to_string(),
+            );
+            return;
+        };
+        let plan = match session::make_plan(&self.settings, &repo, &profile) {
+            Ok(plan) => plan,
+            Err(error) => {
+                self.notice = Some(error.to_string());
+                return;
+            }
+        };
+        let steps: Result<Vec<Step>, anyxboxx::run::RunError> = if precompile_only {
+            launch::precompile_steps(&plan)
+        } else {
+            launch::play_steps(&plan, self.settings.options.warm_first)
+        };
+        match steps {
+            Ok(steps) => self.spawn_steps(steps, precompile_only),
+            Err(error) => self.notice = Some(error.to_string()),
+        }
+    }
+
+    fn spawn_steps(&mut self, steps: Vec<Step>, shaders_only: bool) {
+        let labels: Vec<String> = steps.iter().map(|s| s.label.clone()).collect();
+        let (tx, rx) = mpsc::channel();
+        let cancel = Arc::new(AtomicBool::new(false));
+        job::spawn_cancellable(steps, tx, Arc::clone(&cancel));
+        self.running = Some(Running {
+            events: rx,
+            shaders_only,
+            stages: launch_progress::stages_of(&labels),
+            cancel,
+        });
+        self.step = None;
+        self.summary = Summary::default();
+        self.tracker = Tracker::start(self.now_secs());
+        self.banner = None;
+        self.notice = None;
+    }
+
+    /// Cleans the shader cache after the user confirmed.
+    pub fn clean_cache(&mut self) {
+        self.confirm_clean = false;
+        let Some(dir) = self.cache_dir.clone() else {
+            self.notice = Some("No cache folder: LOCALAPPDATA is not set.".to_string());
+            return;
+        };
+        self.notice = Some(match cache::clean_cache(&dir) {
+            Ok(cache::CleanOutcome::Removed) => format!("Shader cache removed: {}", dir.display()),
+            Ok(cache::CleanOutcome::NothingToClean) => "No shader cache to remove.".to_string(),

Fixed in a33c5f41: cleaning the shader cache now deletes the warm marker, and a warm listed after "Building VIctory" checks the fingerprint of the rebuilt victory.exe before it runs (marker written with that fingerprint). Tests added in warm_state.rs, job.rs and launch.rs.

🤖 Generated with Claude Code

**@⁠LooperSalty** on GitHub · 2026-11-26 11:41 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#discussion_r4707855041) On `crates/anyxboxx-launcher/src/app.rs` line 358 (outdated): ```diff @@ -0,0 +1,391 @@ +//! The window's state and the actions behind its buttons. Long work (folder checks, VIctory's +//! translate and game) runs on threads; this module drains their results once per frame. + +use std::collections::VecDeque; +use std::path::PathBuf; +use std::sync::Arc; +use std::sync::atomic::AtomicBool; +use std::sync::mpsc::{self, Receiver}; +use std::time::Instant; + +use crate::app_check::ManifestState; +use crate::app_launch::Banner; +use crate::cache; +use crate::host::{self, Adapter, GpuVendor, Host}; +use crate::job::{self, Event, Step}; +use crate::launch; +use crate::launch_progress::{self, Stage, Tracker}; +use crate::manifest::Outcome; +use crate::picker::{self, Pick}; +use crate::processes::Tasklist; +use crate::profile::{Profile, Profiles}; +use crate::progress::{Progress, Summary}; +use crate::session::{self, Settings}; +use crate::setup::{self, Item}; +use crate::splash::Splash; +use crate::store::{self, Stored}; +use crate::toast::Toasts; +use crate::verify::Report; + +/// Lines kept in the log view. +const LOG_CAPACITY: usize = 2000; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Tab { + Home, + Setup, + Files, + Shaders, + Play, +} + +/// The game folder check. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Verify { + NotRun, + Running, + Done(Report), + Failed(String), +} + +/// A job running on its thread, whether it is the shader step, its stages and its cancel switch. +pub struct Running { + pub events: Receiver<Event>, + pub shaders_only: bool, + pub stages: Vec<Stage>, + pub cancel: Arc<AtomicBool>, +} + +pub struct App { + pub repo: Option<PathBuf>, + pub profiles: Profiles, + pub host: Host, + pub gpu: GpuVendor, + pub adapter_name: Option<String>, + adapters: Option<Vec<Adapter>>, + pub setup: Vec<Item>, + pub settings: Settings, + pub tab: Tab, + pub verify: Verify, + pub(crate) verify_rx: Option<Receiver<Result<Report, String>>>, + pub(crate) verify_started: Option<std::time::Instant>, + /// The optional SHA-256 manifest job; it never gates PLAY. + pub manifest: ManifestState, + pub(crate) manifest_rx: Option<Receiver<Outcome>>, + pub running: Option<Running>, + pub log: VecDeque<String>, + pub summary: Summary, + pub notice: Option<String>, + /// Set when the game is up and the launcher may close (see `keep_open_after_launch`). + pub close_requested: bool, + pub confirm_clean: bool, + pub cache_dir: Option<PathBuf>, + pub splash: Splash, + pub toasts: Toasts, + /// The step the running job is on (`Building VIctory`, `Running the game`...). + pub step: Option<String>, + pub drawer_open: bool, + /// Whether the shader cache folder holds something (looked at every couple of seconds). + pub cache_ready: bool, + pub cache_checked_at: f64, + /// When the page on screen was switched to, in egui seconds (for the page transition). + pub tab_changed_at: f64, + pub shown_tab: Tab, + /// Start the game as soon as the folder check passes (PLAY pressed before it ended). + pub launch_when_ready: bool, + /// The launch screen's model: stage, progress, pace. + pub tracker: Tracker, + /// The outcome of the last job, shown as a card until dismissed or replaced. + pub banner: Option<Banner>, + /// Shows the launch screen without running anything (`--preview-launch`, debug builds only). + pub preview_launch: bool, + pub(crate) clock: Instant, + pick_rx: Option<Receiver<(Pick, Option<PathBuf>)>>, + settings_path: Option<PathBuf>, + last_saved: Stored, +} + +/// The checklist as the machine is now; `adapters` is what DXGI listed (None when it failed). +fn read_setup(adapters: Option<&[crate::host::Adapter]>) -> Vec<Item> { + let system_root = std::env::var_os("SystemRoot").unwrap_or_else(|| "C:\\Windows".into()); + let program_files = std::env::var_os("ProgramFiles(x86)") + .map_or_else(|| PathBuf::from("C:\\Program Files (x86)"), PathBuf::from); + let kits = program_files.join("Windows Kits").join("10").join("bin"); + let facts = setup::probe( + &PathBuf::from(system_root), + &kits, + adapters.map(<[_]>::to_vec), + ); + setup::checklist(&facts) +} + +impl App { + /// The window's first state: the setup checklist, the GPU and the host are read now. + pub fn new() -> Result<Self, String> { + let profiles = Profiles::embedded().map_err(|e| e.to_string())?; + let settings_path = store::current_path(); + let settings = settings_path + .as_deref() + .and_then(store::load) + .map(Stored::into_settings) + .unwrap_or_default(); + let settings_copy = settings.clone(); + let host = host::detect_host(); + let adapters = host::enumerate_adapters().ok(); + let gpu = adapters + .as_deref() + .map_or(GpuVendor::Unknown, host::vendor_of); + let adapter_name = adapters + .as_deref() + .and_then(host::main_adapter) + .map(|a| a.name.clone()); + let mut app = App { + repo: anyxboxx::run::find_repo(None), + profiles, + host, + gpu, + adapter_name, + setup: read_setup(adapters.as_deref()), + adapters, + settings, + tab: Tab::Home, + verify: Verify::NotRun, + verify_rx: None, + verify_started: None, + manifest: ManifestState::NotRun, + manifest_rx: None, + running: None, + log: VecDeque::new(), + summary: Summary::default(), + notice: None, + close_requested: false, + confirm_clean: false, + cache_dir: cache::current_cache_dir(), + splash: Splash::new(), + toasts: Toasts::default(), + step: None, + drawer_open: false, + cache_ready: false, + cache_checked_at: 0.0, + tab_changed_at: 0.0, + shown_tab: Tab::Home, + last_saved: Stored::from_settings(&settings_copy), + launch_when_ready: false, + tracker: Tracker::default(), + banner: None, + preview_launch: false, + clock: Instant::now(), + pick_rx: None, + settings_path, + }; + app.find_game_folder(); + if app.settings.game_path().is_some() { + app.start_verify(); + } + Ok(app) + } + + /// Keeps the saved game folder when it still holds the game, else looks for one next to the + /// launcher and in its parents. + fn find_game_folder(&mut self) { + let last = self.settings.game_path(); + let launcher = picker::launcher_dir(); + let found = picker::detect(launcher.as_deref(), last.as_deref()); + if let Some(dir) = found { + self.settings.game_dir = dir.display().to_string(); + } + } + + /// Opens the folder dialog on its own thread. + pub fn pick_game_folder(&mut self) { + self.open_dialog(Pick::GameFolder); + } + + /// Opens the file dialog for the xg_xs.dll. + pub fn pick_xg_library(&mut self) { + self.open_dialog(Pick::XgLibrary); + } + + fn open_dialog(&mut self, kind: Pick) { + if self.pick_rx.is_some() { + return; + } + let start = match kind { + Pick::GameFolder => self.settings.game_path(), + Pick::XgLibrary => PathBuf::from(self.settings.xg_dll.trim()) + .parent() + .map(PathBuf::from), + }; + self.pick_rx = Some(picker::open(kind, start)); + } + + /// Uses `dir` as the game folder when it is one (error toast otherwise), then checks it. + pub fn set_game_folder(&mut self, dir: &std::path::Path) { + match picker::validate_game_folder(dir) { + Ok(()) => { + self.settings.game_dir = dir.display().to_string(); + self.manifest = ManifestState::NotRun; + self.notice = Some(format!("Game folder saved: {}", dir.display())); + self.start_verify(); + } + Err(reason) => self.notice = Some(format!("Cannot use this folder: {reason}")), + } + } + + /// Takes the answer of a dialog, if one came. + fn poll_dialog(&mut self) { + let Some(rx) = &self.pick_rx else { + return; + }; + let Ok((kind, chosen)) = rx.try_recv() else { + return; + }; + self.pick_rx = None; + let Some(path) = chosen else { + return; + }; + match kind { + Pick::GameFolder => self.set_game_folder(&path), + Pick::XgLibrary => self.settings.xg_dll = path.display().to_string(), + } + } + + /// A folder (or a file of it) dropped on the window becomes the game folder. + pub fn handle_drops(&mut self, ctx: &eframe::egui::Context) { + let dropped = ctx.input(|i| i.raw.dropped_files.first().and_then(|f| f.path.clone())); + if let Some(path) = dropped { + self.set_game_folder(&picker::folder_of_drop(&path)); + } + } + + /// The profile for this host and GPU. + pub fn profile(&self) -> &Profile { + self.profiles.select(self.host, self.gpu) + } + + /// Reads the checklist again (after the user installed something). + pub fn refresh_setup(&mut self) { + self.setup = read_setup(self.adapters.as_deref()); + } + + /// The repository folder, or an empty path when none was found (the plan is then only shown). + pub fn repo_or_empty(&self) -> PathBuf { + self.repo.clone().unwrap_or_default() + } + + /// Where VIctory keeps saves and data: `VICTORY_DATA_DIR`, else `%LOCALAPPDATA%\victory\data`. + pub fn data_dir_label(&self) -> String { + let data = std::env::var_os("VICTORY_DATA_DIR") + .filter(|v| !v.is_empty()) + .map(PathBuf::from) + .or_else(|| { + std::env::var_os("LOCALAPPDATA") + .map(|l| PathBuf::from(l).join("victory").join("data")) + }); + data.map_or("unknown".to_string(), |d| d.display().to_string()) + } + + pub fn is_busy(&self) -> bool { + self.running.is_some() || matches!(self.verify, Verify::Running) + } + + /// The last progress report of the translate, for the bar. + pub fn progress(&self) -> Option<&Progress> { + self.summary.last_progress.as_ref() + } + + /// Starts the play steps, or the shader preloading alone; refused while a game runs. + pub fn start(&mut self, precompile_only: bool) { + if self.is_busy() { + return; + } + if let Err(error) = session::guard(&self.settings, &Tasklist) { + self.notice = Some(error.to_string()); + return; + } + let profile = self.profile().clone(); + let Some(repo) = self.repo.clone() else { + self.notice = Some( + "AnyXboxX folder not found: run the launcher from the repository (target\\release).".to_string(), + ); + return; + }; + let plan = match session::make_plan(&self.settings, &repo, &profile) { + Ok(plan) => plan, + Err(error) => { + self.notice = Some(error.to_string()); + return; + } + }; + let steps: Result<Vec<Step>, anyxboxx::run::RunError> = if precompile_only { + launch::precompile_steps(&plan) + } else { + launch::play_steps(&plan, self.settings.options.warm_first) + }; + match steps { + Ok(steps) => self.spawn_steps(steps, precompile_only), + Err(error) => self.notice = Some(error.to_string()), + } + } + + fn spawn_steps(&mut self, steps: Vec<Step>, shaders_only: bool) { + let labels: Vec<String> = steps.iter().map(|s| s.label.clone()).collect(); + let (tx, rx) = mpsc::channel(); + let cancel = Arc::new(AtomicBool::new(false)); + job::spawn_cancellable(steps, tx, Arc::clone(&cancel)); + self.running = Some(Running { + events: rx, + shaders_only, + stages: launch_progress::stages_of(&labels), + cancel, + }); + self.step = None; + self.summary = Summary::default(); + self.tracker = Tracker::start(self.now_secs()); + self.banner = None; + self.notice = None; + } + + /// Cleans the shader cache after the user confirmed. + pub fn clean_cache(&mut self) { + self.confirm_clean = false; + let Some(dir) = self.cache_dir.clone() else { + self.notice = Some("No cache folder: LOCALAPPDATA is not set.".to_string()); + return; + }; + self.notice = Some(match cache::clean_cache(&dir) { + Ok(cache::CleanOutcome::Removed) => format!("Shader cache removed: {}", dir.display()), + Ok(cache::CleanOutcome::NothingToClean) => "No shader cache to remove.".to_string(), ``` Fixed in a33c5f41: cleaning the shader cache now deletes the warm marker, and a warm listed after "Building VIctory" checks the fingerprint of the rebuilt victory.exe before it runs (marker written with that fingerprint). Tests added in warm_state.rs, job.rs and launch.rs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
@ -0,0 +91,4 @@
let marker = warm_state::marker_path(std::env::var_os("LOCALAPPDATA").as_deref());
crate::launch::warm_check(
&victory.exe,
&env,
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-26 11:41 UTC · original

Fixed in a33c5f41: cleaning the shader cache now deletes the warm marker, and a warm listed after "Building VIctory" checks the fingerprint of the rebuilt victory.exe before it runs (marker written with that fingerprint). Tests added in warm_state.rs, job.rs and launch.rs.

🤖 Generated with Claude Code

**@⁠LooperSalty** on GitHub · 2026-11-26 11:41 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/351#discussion_r4707855600) Fixed in a33c5f41: cleaning the shader cache now deletes the warm marker, and a warm listed after "Building VIctory" checks the fingerprint of the rebuilt victory.exe before it runs (marker written with that fingerprint). Tests added in warm_state.rs, job.rs and launch.rs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github manually merged commit 8ed1109fa9 into main 2026-11-26 11:48:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.