From e890d0a1019a7c796aa4dbf1aae818bdb5ff5a1b Mon Sep 17 00:00:00 2001 From: Jan Trencansky Date: Sat, 28 Nov 2026 09:09:23 -0500 Subject: [PATCH] docs: fix inaccurate doc paths/flags/env vars and add recommended variables to running.md - docs/running.md: add Recommended variables (all platforms) table covering async submit/compile, compile-pool sizing, warm-up throttling, heap sizing, input, and telemetry/fault variables on main; update RX 7900 XTX RADV recipe and Reporting section - runtime/README.md: document LEONIDA_CLWB_PATCH (runtime/src/cpu_emulation.h) - AGENTS.md: add port_ctl.py (scripts/port_ctl.py) to numpy/Pillow exception list - d3d12/docs/replay.md: fix nonexistent --looks flag reference to --flow - docs/port_plan.md, docs/port_status.md, docs/ultrawide.md, docs/victory_gap_gpu.md, docs/victory_gap_media.md: fix typos (chad_dsp.cpp -> chad.cpp, VIctory tests/fidelityfx.rs -> crates/victory-hle/tests/fidelityfx.rs) and clearly mark unmerged-branch paths (runtime/ ultrawide, frame_step.h, media_foundation.cpp, gameinput_xinput.cpp, d3d12_xs_exports_test.cpp, pipeline_queue.h -> pipeline_wait.h) - tests/test_docs_cli_flags.py: scan .rs sources and clap #[arg(long)] struct fields for d3d12/docs/*.md flags, treat cargo/git-filter-repo flags as foreign, and add docs/port_plan.md to OTHER_PROJECTS AI-assisted: Antigravity (Gemini 4 Neon). Verified: 13/13 tests/test_docs_*.py pass and scripts/check_no_game_data.py clean. --- AGENTS.md | 7 ++++--- d3d12/docs/replay.md | 2 +- docs/port_plan.md | 2 +- docs/port_status.md | 10 +++++---- docs/running.md | 40 ++++++++++++++++++++++++++++-------- docs/ultrawide.md | 20 ++++++++++-------- docs/victory_gap_gpu.md | 3 ++- docs/victory_gap_media.md | 13 ++++++------ runtime/README.md | 1 + tests/test_docs_cli_flags.py | 33 +++++++++++++++++++++++------ 10 files changed, 93 insertions(+), 38 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1448887955..d5ca869746 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -124,9 +124,10 @@ Shard runs write `index.part*.json`; merge them into `index.json` with `--merge` ## Conventions - Python tools run with `python -I` and use only the standard library unless a file says otherwise; the exceptions - are the texture and model tools that import numpy or Pillow: `bc_feature.py`, `amd_swizzle.py`, `tile_probe.py`, - `swizzle_search.py`, `tex_export.py`, `tex_mode_probe.py`, `calibrated_texture.py`, `world_grid_atlas.py`, - `tex_headers.py` and `skinned_glb.py` (which fall back to the standard library when numpy is absent). + are the texture, model and control tools that import numpy or Pillow: `bc_feature.py`, `amd_swizzle.py`, + `tile_probe.py`, `swizzle_search.py`, `tex_export.py`, `tex_mode_probe.py`, `calibrated_texture.py`, + `world_grid_atlas.py`, `port_ctl.py`, `tex_headers.py` and `skinned_glb.py` (the last two fall back to the + standard library when numpy is absent). - A text file a tool writes names its line ending - `open(path, "w", encoding="utf-8", newline="\n")` - so the same input gives the same bytes on every platform; `tests/test_text_write_line_endings.py` catches a writer that forgets. - Keep `make_game.py` working on Windows first: paths through `os.path`, no bash in the build. diff --git a/d3d12/docs/replay.md b/d3d12/docs/replay.md index 7f1dc1421c..0853ff8176 100644 --- a/d3d12/docs/replay.md +++ b/d3d12/docs/replay.md @@ -93,7 +93,7 @@ targets (where the viewport has the picture's shape), dispatches and draws with the textures of the picture's shape shaders may write at that time, copies, resolves and clears. `--of` is the size of the picture the point was read from (a screenshot's). The commands are numbered `:` as in -`--listing`, `--slots` and `--looks`. +`--listing`, `--slots` and `--flow`. | switch | does | |---|---| diff --git a/docs/port_plan.md b/docs/port_plan.md index be99224be7..def2286289 100644 --- a/docs/port_plan.md +++ b/docs/port_plan.md @@ -161,7 +161,7 @@ translate it. - `apps/victory/src/native_1440p.rs`, `fsr_preset.rs`: the title told a 1440p display with FSR at Quality: the display-mode lever (`port/present`). -- `crates/victory-hle/src/modules/fidelityfx.rs` (+ `tests/fidelityfx.rs`): the +- `crates/victory-hle/src/modules/fidelityfx.rs` (+ `crates/victory-hle/tests/fidelityfx.rs`): the title's `amd_fidelityfx_upscaler_xbox.dll` served on the host; Leonida's shader stage translates only 18 of the 29 FidelityFX programs. - `crates/victory-gpu/src/texture/ahead.rs`, `texture/upload.rs`, `tiles.rs`, diff --git a/docs/port_status.md b/docs/port_status.md index a6a5860a2d..6b9a7314ad 100644 --- a/docs/port_status.md +++ b/docs/port_status.md @@ -180,7 +180,8 @@ is on), so title GPU memory can live in VRAM and still be written by the CPU. just before its first `SetFrameIntervalX`, but 1920x1080 (also at 120 Hz, also with `LEONIDA_DEVICE_TYPE=6`) leaves both at 3840x2160. The size is the executable's Series X SDR mode: VIctory upstream's native 1440p profile - (`native_1440p.rs`), ported as `runtime/src/display_profile.h`, patches it + (`native_1440p.rs`, ported on an unmerged `runtime/` branch as `display_profile.h` + and later into `d3d12/crates/leonida-loader/src/hooks.rs`) patches it and three related places in the mapped image, and with `LEONIDA_DISPLAY_MODE=2560x1440` the window and both back buffers are 2560x1440 (`LEONIDA_RENDER_SCALE=0.75` renders 1080p into it). Other sizes @@ -218,7 +219,7 @@ is on), so title GPU memory can live in VRAM and still be written by the CPU. writes when it gets there, the system timestamp the performance counter once the submission has run. The real title cannot exercise them yet: it stops at its render-target pool check before its first frame. -- Time step (`port/frame-timing`, `runtime/src/frame_step.h`): the title's +- Time step (unmerged `port/frame-timing` branch, `frame_step.h`): the title's timer (+0x22264d0, once a frame) steps its time sets by the measured QueryPerformanceCounter delta held to [1/30 s, 1/15 s]: the floor is 1 / the target frame rate (+0x6849844, from the graphics settings), the cap a @@ -379,8 +380,9 @@ scope instead. Measured in run 103: - draws stopped at about 180 s; - the write to 0 came at 211 s, from `game+0x2215c35` through the hook to `game+0x23cf683`. -So the earlier runs that set that budget to delay "the device loss" were what caused it. The budget is now cut to 10 s -(`kMaxWaitMs` in `runtime/src/pipeline_queue.h`), and runs use the default 500 ms. GPU-assisted validation (run 102, +So the earlier runs that set that budget to delay "the device loss" were what caused it. The wait cap was later cut +to 10 s (and the pipeline-wait coordination now lives in `runtime/src/pipeline_wait.h`), with runs using the default +500 ms budget. GPU-assisted validation (run 102, 30 minutes) reported nothing but the known sparse-bind message. Still unexplained in the same load: diff --git a/docs/running.md b/docs/running.md index 3b71966d95..3587cdc49c 100644 --- a/docs/running.md +++ b/docs/running.md @@ -38,6 +38,26 @@ Paths are placeholders: `` is the repository, `` the folder wit `/shaders/spirv/library/index.json`), which drops their dispatches at play, and `LEONIDA_RT_AS=off`, which drops acceleration-structure builds. The picture then lacks what they draw. +## Recommended variables (all platforms) + +Beyond the required platform settings above, these runtime variables (all documented in +[runtime/README.md](../runtime/README.md)) are recommended for smoother start-up, faster pipeline compilation and +better fault diagnostics on current `main`: + +| Setting | Default | Why | +|---|---|---| +| `LEONIDA_SUBMIT_ASYNC=4` | `0` | Moves command-list replay, before-submission refreshes and `vkQueueSubmit` off the title's submitting thread onto per-queue worker threads (up to 4 batches queued). | +| `LEONIDA_ASYNC_PIPELINES=1` | `0` | Builds pipelines on the compile pool instead of blocking draws (pair with `LEONIDA_ASYNC_MIN_BYTES=2097152` and optionally `LEONIDA_ASYNC_MIN_BYTES_GRAPHICS=0` to keep small compute lighting/post passes synchronous while large ray-tracing or graphics pipelines build asynchronously; use `=0` when every pipeline is already pre-compiled and you want zero skipped draws). | +| `LEONIDA_COMPILE_THREADS=16`, `LEONIDA_COMPILE_HEAVY_MAX=14` | half logical cores (2-8) / `threads-1` | Scales parallel pipeline compilation on high-core-count CPUs (adjust to available cores and RAM; pair with `LEONIDA_SERIAL_BIG_COMPILES=0`). | +| `LEONIDA_COMPUTE_WARMUP_MAX_BYTES=8388608`, `LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES=131072` | `8388608` / unset | Bounds speculative warm-up module size and holds back large warm-ups while the title is actively submitting so warm-ups do not starve live frames. | +| `LEONIDA_HEAVY_PIPELINE_CACHE_MS=0` | `0` | Keeps pipeline-cache lookups active for heavy modules instead of bypassing the cache after a threshold. | +| `LEONIDA_STARTUP_CACHE_CHECKPOINTS=1` | unset | Periodically saves pipeline-cache session checkpoints during boot so progress is preserved if a run stops early. | +| `LEONIDA_ARENA_MB=4095`, `LEONIDA_TITLE_WINDOWS_MB=4096`, `LEONIDA_GEOMETRY_MB=6144` | smaller defaults | Room for the title's buffers in the world on 16-24 GB GPUs (reduce on 8 GB cards; with sparse binding the arena size is address range and memory is bound on demand). | +| `LEONIDA_KEYBOARD_PAD=always`, `LEONIDA_RUMBLE=0` | unset / on | Exposes the keyboard as player 1 when no gamepad is attached and disables rumble/haptics overhead. | +| `LEONIDA_DEVICE_FAULT=1`, `LEONIDA_DEVICE_MARKERS=1` | unset | Enables device-loss/stall reports and (on AMD / `VK_AMD_buffer_marker`) per-draw/dispatch GPU markers to pinpoint hangs. | +| `LEONIDA_TITLE_HUD=1` or `LEONIDA_DEV_OVERLAY=1` | unset | Live frame rate, frame time, submission phases, pipeline-compile counts and VRAM/RAM usage on screen. | +| `LEONIDA_GPU_LATENCY=1`, `LEONIDA_MEM_PROBE=30` | unset | Periodic per-queue GPU latency (every 10 s) and VRAM breakdown by consumer (every 30 s) in the runtime log. | + ## Linux, Wine, AMD RX 7900 XTX (RADV) Measured by us on 2026-11-26: RX 7900 XTX, Ryzen 9 7950X3D, Linux 7.3, Mesa 26.3.1 (RADV), Wine. Details and the @@ -59,19 +79,22 @@ reasons behind each step: [linux_proton.md](linux_proton.md#amd-on-linux-what-go | Setting | Why | |---|---| | `LEONIDA_D3D12=vulkan` | the Vulkan backend | + | `MESA_VK_DEVICE_SELECT=1002:744c!` | pins the discrete RX 7900 XTX on systems that also have an integrated GPU | | `LEONIDA_SHADERS=Z:/shaders/spirv` | the native pack | | `LEONIDA_PIPELINE_CACHE_DIR=Z:/pso` | the journal the pre-compile filled | | `MESA_SHADER_CACHE_DIR=/mesa`, `MESA_SHADER_CACHE_MAX_SIZE=16G` | RADV's own cache, large enough for the pack | | `LEONIDA_STARTUP_CACHE_CHECKPOINTS=1` | session cache snapshots during the boot | - | `LEONIDA_ASYNC_PIPELINES=0` | draws wait for their pipeline instead of being skipped | - | `LEONIDA_SERIAL_BIG_COMPILES=0`, `LEONIDA_COMPUTE_WARMUP_MAX_BYTES=8388608` | warm-up limits, as in the NVIDIA report below | + | `LEONIDA_SUBMIT_ASYNC=4` | offloads submission prep and `vkQueueSubmit` onto per-queue workers | + | `LEONIDA_ASYNC_PIPELINES=1` (or `=0`) | `=1` keeps first-run/streaming pipeline compiles off the draw thread (pair with `LEONIDA_COMPILE_THREADS=16`, `LEONIDA_COMPILE_HEAVY_MAX=14`); `=0` waits for every pipeline instead of skipping draws | + | `LEONIDA_SERIAL_BIG_COMPILES=0`, `LEONIDA_HEAVY_PIPELINE_CACHE_MS=0`, `LEONIDA_COMPUTE_WARMUP_MAX_BYTES=8388608`, `LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES=131072` | parallel big compiles with cache lookups kept active and live-frame warm-up throttling | | `LEONIDA_RT_AS=off`, `LEONIDA_SKIP_COMPUTE=` | the large ray-tracing programs, left out at play as in our longest runs ([above](#settings-every-platform-needs)) | | `LEONIDA_TITLE_WATCHDOG=0`, `LEONIDA_TITLE_WATCHDOG_KICK=,` | the title's hang watchdog ([above](#settings-every-platform-needs)) | | `LEONIDA_DEVICE_TYPE=6`, `LEONIDA_MAP_READBACK=1`, `LEONIDA_FRAME_PACING=1`, `LEONIDA_PRESENT_NO_TEAR=1` | taken over from the NVIDIA report below; their effect on AMD was not measured one by one | | `LEONIDA_ARENA_MB=4095`, `LEONIDA_TITLE_WINDOWS_MB=4096`, `LEONIDA_GEOMETRY_MB=6144` | room for the title's buffers in the world | | `LEONIDA_SHADOW_ALIAS_MS=5000`, `LEONIDA_CONSOLE_FIX_US=0` | carried from earlier boot runs; their effect here was not measured one by one | - | `LEONIDA_DEVICE_FAULT=1` | a device-loss report if the GPU hangs | - | `LEONIDA_KEYBOARD_PAD=always` | the keyboard as the pad | + | `LEONIDA_DEVICE_FAULT=1`, `LEONIDA_DEVICE_MARKERS=1` | device-loss/stall report plus `VK_AMD_buffer_marker` draw/dispatch attribution if the GPU hangs | + | `LEONIDA_GPU_LATENCY=1`, `LEONIDA_MEM_PROBE=30`, `LEONIDA_TITLE_HUD=1`, `LEONIDA_DEV_OVERLAY=1` | optional live telemetry and overlays | + | `LEONIDA_KEYBOARD_PAD=always`, `LEONIDA_RUMBLE=0` | keyboard as player 1 without rumble overhead | - **Command:** from ``, `wine /gta6rt.exe --run Z: --game-dir Z:`. - **What to expect:** menus at 30 frames/s with no in-game compiling; the world after the story load, over eight @@ -157,7 +180,8 @@ TBD. ## Reporting -Post a run in the coordination issue, with the fields of these sections: machine (OS, GPU, driver, RAM), the commit, -how the shaders were made, the pipeline pre-compile, the OS and driver settings, every `LEONIDA_*` variable that -differs from the defaults (never the watchdog's RVA values), and how far the run got with its frame rate. Keep logs, -traces and screenshots on your machine ([linux_proton.md](linux_proton.md#reporting-a-result)). +Post a `RUN` block ([agent_collaboration.md](agent_collaboration.md)) in the game-run tracking or coordination issue, +with the fields of these sections: machine (OS, GPU, driver, RAM), the commit, how the shaders were made, the pipeline +pre-compile, the OS and driver settings, every `LEONIDA_*` variable that differs from the defaults (never the +watchdog's RVA values), and how far the run got with its frame rate. Keep logs, traces and screenshots on your machine +([linux_proton.md](linux_proton.md#reporting-a-result)). diff --git a/docs/ultrawide.md b/docs/ultrawide.md index 2962cef490..6570401511 100644 --- a/docs/ultrawide.md +++ b/docs/ultrawide.md @@ -4,6 +4,10 @@ How the output size goes from the window to the title and back to the screen, an change. **Measured** means a run, a test or the code shows it (file:line quoted, line numbers as of this note); **hypothesis** means nobody has checked it yet. +> **Status on `main`:** The C++ `runtime/` changes described in the first two sections below were written against an +> unmerged `runtime/` branch (`aspect_fit.h`, `display_mode.h`, `display_profile.h` are not in `runtime/` on `main`). +> The Rust `d3d12/` implementation in [The D3D12 runtime (`d3d12/`)](#the-d3d12-runtime-d3d12) below is on `main`. + ## Settings | variable | default | what it changes | @@ -11,8 +15,8 @@ change. **Measured** means a run, a test or the code shows it (file:line quoted, | `LEONIDA_ASPECT` | unset | `21:9`, `32:9`, `43:18`, any `W:H` or decimal from 1 to 4, or `auto` (the primary monitor's shape). The display mode the console output reports is widened to that aspect at the same height, and so is the title's window. `off`, `none` or empty: unset. | | `LEONIDA_PRESENT_SCALE` | `stretch`, or `fit` with `LEONIDA_ASPECT` | `fit`: a frame whose shape is not the window's keeps its aspect, centred, with black bars beside it (pillarbox) or above and below (letterbox). A frame of the window's shape fills it. `stretch`: the frame fills the window, as before. | -`scripts/play.ps1 -Aspect 21:9` (and `-PresentScale fit|stretch`) sets them. The arithmetic is in -`runtime/src/aspect_fit.h` and `runtime/test/aspect_fit_test.cpp` tests it. +On that unmerged `runtime/` branch, `scripts/play.ps1 -Aspect 21:9` (and `-PresentScale fit|stretch`) set them, with +the arithmetic in `aspect_fit.h` and unit tests in `aspect_fit_test.cpp`. | `LEONIDA_DISPLAY_MODE` | `LEONIDA_ASPECT` | the title is told | |---|---|---| @@ -26,13 +30,13 @@ change. **Measured** means a run, a test or the code shows it (file:line quoted, 1. **The display mode the title is told.** `rt::d3d12::title_display_mode()` (`runtime/shims/xbox_display.cpp:324`) answers the console output's slot 21 (`output_modes`, `:230`), its `GetDesc` desktop coordinates (`:178`), - `GetDisplayModeList` (`:202`) and `FindClosestMatchingMode`. It reads `LEONIDA_DISPLAY_MODE` (default 3840x2160, - `runtime/src/display_mode.h`) and now widens the result with `LEONIDA_ASPECT` (`title_aspect_ratio()`, `:294`). + `GetDisplayModeList` (`:202`) and `FindClosestMatchingMode`. On that branch it read `LEONIDA_DISPLAY_MODE` + (default 3840x2160, `display_mode.h`) and widened the result with `LEONIDA_ASPECT` (`title_aspect_ratio()`, `:294`). Measured (docs/port_status.md, "The title makes its window at 3840x2160"): the 1.0.2.1 title calls slot 21 just before its first `SetFrameIntervalX`, but its window and back buffers stay 3840x2160 whatever slot 21 reports. 1920x1080 was tried at 60 and 120 Hz. 2. **The size the title renders at.** This size is compiled into the executable: the Series X SDR mode at RVA - `0x0615c100` (`runtime/src/display_profile.h:46`), the scanout reservation, the temporal scene scale and the + `0x0615c100` (`display_profile.h:46`), the scanout reservation, the temporal scene scale and the Settings viewport. `runtime/src/main.cpp:65-82` patches these when `LEONIDA_DISPLAY_MODE=2560x1440`. Every other output is refused (`display_profile.h:100`). Measured: with the SDR mode set to 1920x1080 the title still made 2560x1440 buffers. `LEONIDA_ASPECT` does not change the executable. @@ -123,9 +127,9 @@ Read from the 1.0.2.1 executable (offsets are RVAs; none of this is measured in for 7:3 by whatever uses that function. The constant 16/9 at 0x615a1c0 is loaded by at least seven more instructions (0x73c7a7, 0x19148bc, 0x28c07bd, 0x3108ddd, 0x32be281, 0x3b6c5f5, 0x4163240), none of them read yet. -`LEONIDA_OUTPUT=WIDTHxHEIGHT` (`hooks.rs`, EXPERIMENTAL) changes the first three together: the 3840x2160 row, the -reservation that fits it and the Settings viewport pointed at the row, after VIctory's native 1440p profile -(`runtime/src/display_profile.h`). `LEONIDA_OUTPUT_1440=1` is now the same with 2560x1440. A unit test checks the +`LEONIDA_OUTPUT=WIDTHxHEIGHT` (`d3d12/crates/leonida-loader/src/hooks.rs`, EXPERIMENTAL) changes the first three +together: the 3840x2160 row, the reservation that fits it and the Settings viewport pointed at the row, after +VIctory's native 1440p profile. `LEONIDA_OUTPUT_1440=1` is now the same with 2560x1440. A unit test checks the bytes each place holds against the 1.0.2.1 executable (`LEONIDA_GAME_DIR`). What blocks calling it ultrawide, each needing a run: diff --git a/docs/victory_gap_gpu.md b/docs/victory_gap_gpu.md index 5cdbcf7a1b..169912fc39 100644 --- a/docs/victory_gap_gpu.md +++ b/docs/victory_gap_gpu.md @@ -58,5 +58,6 @@ closed on this branch; **left** = gap kept, with the reason. "V" is `victory/cra - `xs_proxy_mock` (`runtime/test/xs_proxy_mock_test.cpp`): `check_console_headers`, `check_console_features`, and slot 13 in the slot-table check. -- `d3d12_xs_exports` (`runtime/test/d3d12_xs_exports_test.cpp`): the IID data import and the virtual memory range. +- `d3d12_xs_exports` (`d3d12_xs_exports_test.cpp` on the gap branch; not merged into `main`): the IID data import and + the virtual memory range. - `xgameruntime_offline`: the deferral is an open power-request handle; null output refused. diff --git a/docs/victory_gap_media.md b/docs/victory_gap_media.md index 393a849d0e..f08f900ad4 100644 --- a/docs/victory_gap_media.md +++ b/docs/victory_gap_media.md @@ -19,7 +19,7 @@ Status: **same** (Leonida already matched VIctory), **ported** (on this branch), | process command | Opus decoded to float PCM (`opus_pure`) | packet parsed (`src/opus_packet.h`): frame counts, lengths and errors are the packet's, samples are silence | **left**: Leonida has no Opus decoder. VIctory's comes from the `opus-pure` crate, which is not in this repository; a port is a full SILK/CELT decoder. Speech and Opus-coded audio stay silent, nothing waits on it | | `XApuDequeueResult`, `XApuGetResultCount` | result queue | same | same | -## Audio DSP: `chad.dll` (`dsp.rs` / `runtime/shims/chad_dsp.cpp`) +## Audio DSP: `chad.dll` (`dsp.rs` / `runtime/shims/chad.cpp`) | Export | VIctory | Leonida before | Status | |---|---|---|---| @@ -38,7 +38,7 @@ Status: **same** (Leonida already matched VIctory), **ported** (on this branch), | other SHAPE units (rate conversion, EQ, filters, flowgraph mixing) | acknowledged, not carried out | same | same (neither emulates them) | | `audio/capture.rs` (`VICTORY_AUDIO_CAPTURE`) | diagnostics build only: records the title's output to a WAVE file through process loopback | none | **left**: a debugging aid outside the title's API, not on any boot path | -## Media Foundation: `mfplat.dll` (`media.rs` / new `runtime/shims/media_foundation.cpp`) +## Media Foundation: `mfplat.dll` (`media.rs` / unmerged `port/gap-media` `media_foundation.cpp`) | Export or method | VIctory | Leonida before | Status | |---|---|---|---| @@ -61,7 +61,7 @@ Status: **same** (Leonida already matched VIctory), **ported** (on this branch), | 16 `GetStreamData` | an empty 16 kHz mono 16-bit WAVE file; too small a buffer `E_NOT_SUFFICIENT_BUFFER` | `E_INVALIDARG` | **ported** | | 3-7, 17-20 captions, high contrast, speech to text | missing in VIctory | answered (contrast Off, captions accepted, the rest `E_FAIL`) | same or better | -## Input: `gameinput.dll` (`gameinput.rs`, `gameinput/dualsense.rs` / `runtime/shims/gameinput.cpp`, new `runtime/shims/gameinput_xinput.cpp`) +## Input: `gameinput.dll` (`gameinput.rs`, `gameinput/dualsense.rs` / `runtime/shims/gameinput.cpp`, `runtime/shims/gameinput_no_sdl.cpp`; unmerged `port/gap-media` `gameinput_xinput.cpp`) Leonida's GameInput shim (`gameinput.cpp`) runs on SDL3 and is much broader than VIctory's (any SDL pad, force feedback, raw HID, motion, UI navigation, a dispatcher). But it is built only when SDL3 is found, and the main build @@ -104,8 +104,9 @@ Without it the XInput shim above serves the title, so input works either way. All synthetic, run one by one with `ctest -R`: -- `gameinput_xinput` (`runtime/test/gameinput_xinput_test.cpp`): VIctory's GameInput cases over a fake host, the +- `gameinput_xinput` (`gameinput_xinput_test.cpp` on the unmerged `port/gap-media` branch; `main` tests the + non-SDL3 fallback in `runtime/test/gameinput_no_sdl_test.cpp`): VIctory's GameInput cases over a fake host, the DualSense report decoder, the stand-in key map, and the `#1` registration. -- `media_foundation` (`runtime/test/media_foundation_test.cpp`): VIctory's URL cases, console paths through - `rt::fs::read_path`, and the proxy over a fake host resolver. +- `media_foundation` (`media_foundation_test.cpp` on the unmerged `port/gap-media` branch): VIctory's URL cases, + console paths through `rt::fs::read_path`, and the proxy over a fake host resolver. - `xgameruntime_offline` (`runtime/test/xgameruntime_offline_test.cpp`): the silent speech stream, byte for byte. diff --git a/runtime/README.md b/runtime/README.md index 1a3d18f429..b8c2c87898 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -404,6 +404,7 @@ ones marked *diagnostic* only add log lines or exist to compare a run with and w | `LEONIDA_SHADOW_ALIAS_MS` | `0` | The shortest time, in milliseconds, between two copies of the title-memory pages that XMem maps at two addresses into the slot-133 shadows and title windows: pages a write reached since they were guarded at every address, or every time while they can't be (a page pinned for a kernel write). `0` copies them at every submission; a larger value lets a GPU read of them be up to that many milliseconds behind the title's writes. | | `LEONIDA_SHADOW_KEEP` | on | The slot-133 shadows and title windows copy a page only in the 256-byte pieces where the title's bytes changed since the last copy, so what a shader stored in the copy stays, also on pages copied without a sign that the title wrote them (aliased while they can't be guarded at every address, unguarded, pinned). A title writing the same bytes again to reset such a value is not seen. `0` copies those pages whole, as before, overwriting the GPU's writes. | | `LEONIDA_REFRESH_PER_FRAME` | `0` | Trades correctness for speed. `1`: the slot-133 shadows, title windows and geometry copies are brought up to date only by the first submission after each present, not by every submission; `2`: the console descriptor heaps too. A GPU read of them can then be a frame behind the title's writes (wrong pixels). `0` refreshes all of them at every submission. | +| `LEONIDA_CLWB_PATCH` | on | Rewrites trapping `CLWB` instructions in title code in place to `CLFLUSHOPT` (or a same-length `NOP` when the host CPU lacks `CLFLUSHOPT`) on the first `#UD` fault instead of trapping on every execution (`src/cpu_emulation.h`). `0` keeps emulating every `CLWB` through the exception handler. | | `LEONIDA_GEOMETRY_ASYNC` | unset | Trades correctness for speed. `1` refreshes the geometry copies (`shims/d3d12_geometry_views.h`) on a worker thread of the layer, started at submission and not waited for, instead of on the title's submitting thread. A draw may read a copy the worker is still writing: wrong vertices for a frame. | | `LEONIDA_GEOMETRY_WHOLE_VIEWS` | unset | A geometry copy that is already filled copies only the 64 KiB tiles of title memory written since the last refresh (`shims/d3d12_geometry_views.h`). Any value other than `0` copies every view over a written tile whole, as before. | | `LEONIDA_GEOMETRY_HOST` | unset | Where the geometry copies (`shims/d3d12_geometry_views.h`, under `LEONIDA_GEOMETRY_MB`) live. Unset or `0`: device-local memory through the BAR while the driver gives it (several GB of VRAM in a world run). `1`: system memory outside VRAM, write-back where the device offers a cached host type; `2`: system memory, write-combined. The GPU then reads every vertex and index of a copy over the bus, which can cost frame time in geometry-heavy passes. A device whose host-visible memory is all device-local (an integrated GPU) keeps its types. The choice is logged once and in the `geometry buffers` line. | diff --git a/tests/test_docs_cli_flags.py b/tests/test_docs_cli_flags.py index 3df6995b33..2514ce9aa4 100644 --- a/tests/test_docs_cli_flags.py +++ b/tests/test_docs_cli_flags.py @@ -21,15 +21,20 @@ ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) FLAG = re.compile(r"(?