Commit Graph

982 Commits

Author SHA1 Message Date
d442851972 Merge remote-tracking branch 'mandy/main' into merge/mandy-main 2026-11-27 17:58:49 -05:00
b87abdef57 Merge mandy's main into port/d3d12-nvidia
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.

Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.

Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:50:37 -05:00
3e4d890c56 Merge pull request #2435 from quartz-heron-58/mesh-serial-waves
rdna2spirv: --mesh-serial-waves, an emulated mesh program's waves one after the other (SHADER-W64-MESH-SERIAL-WAVES)
2026-11-27 23:50:27 +01:00
39f52f39c4 Merge pull request #2481 from enlight3d/boot-precompiled-journal
windows-boot: read the precompiled journal beside gta6rt.exe as the boot's seed (BOOT-PRECOMPILED-JOURNAL)
2026-11-27 17:47:31 -03:00
ac114f163a Merge pull request #2453 from Tyrannys/test-gpu-oob-harness-msg
GPU tests: give cs_pk_mul_lo_const its 128 words, keep the exit message of a dump row (TEST-GPU-OOB-AND-HARNESS-MSG)
2026-11-27 17:47:23 -03:00
43a9d562d3 Merge pull request #2193 from EdenBendheim/ubiq/ci-check-parallel-stdlib
Verified the Windows check with Python 3.12: 509 standalone files passed with two workers. The seven changed or runner-related files passed on updated main. The .NET 8 build and diagnostics and the native BCPack checks passed with the prerequisite fixes, including #1771. CPU-only, AI-assisted testing.
2026-11-27 14:56:46 -03:00
2893fae21c windows-boot: compare the boot's journal and the seed by Windows' final paths (BOOT-PRECOMPILED-JOURNAL)
The seed was kept when LEONIDA_PIPELINE_CACHE_DIR named the precompiled folder under another spelling (a
junction, or the \\.\ device prefix), although the runtime's std::filesystem checks see one folder and turn
the journal off. Ask Windows for each folder's final path (GetFinalPathNameByHandle, from the deepest
existing parent), which sees through junctions, symbolic links, substituted and mapped drives, 8.3 names and
the \\?\ and \\.\ prefixes; the spelled paths remain the fallback when the helper is not available.
Reported by TheGeogeo's agent (repro on #2481); the approach was suggested by OreoFR's agent. The test file
gains the \\.\ and junction cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:50:56 +01:00
0fa2b4fc4f Merge branch 'feat/presentation' into port/d3d12-nvidia 2026-11-27 12:16:18 -05:00
701cc74966 Launcher and F1 menu: -Dlss, -FrameGen, -Aspect, -PresentScale, -DryRun
scripts\play-d3d12.ps1 and d3d12\scripts\play-nvidia.ps1:
  -Dlss quality|balanced|performance|ultra   DLSS makes the output from 2/3,
                0.6, 1/2 or 1/3 of its lines (Series X: 1440, 1296, 1080, 720)
  -FrameGen 2..6   DLSS frame generation
  -Aspect 21:9|32:9|W:H|auto, -PresentScale fit|stretch   the window's shape
  -DryRun       the settings a start would run with, and nothing started
With none of them a start sets what it set before (Series X: 1440 lines and
the title's own upscaler).

On Series X the launcher puts the pieces together after the F1 menu's saved
choices are read: DLSS or the stretch there means LEONIDA_FSR_UPSCALER=1 and no
LEONIDA_OWN_UPSCALER, with render scale 2/3 unless one is set; frame generation
there turns DLSS on (or is left off without DLSS's files), since its depth and
motion vectors come from that upscale. A menu choice of DLSS without the files
falls back to the title's own upscaler on Series X.

F1 menu: RENDER SCALE names the DLSS modes, UPSCALER's last value is the
game's own on either console, and WINDOW SHAPE and PICTURE IN ANOTHER SHAPE
(live) are new.

The script's own $dlss is now $dlssOn: PowerShell does not tell it from the
-Dlss parameter. Checked with -DryRun over the parameter and menu
combinations; not run in the game.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 12:12:38 -05:00
f0e451db06 Launcher: Smooth Motion back to opt-in (the one default start ended in the title's breakpoint)
leonida_sm.exe started by default ended 2.4 s in with 0x80000003 from the title's main loop; the
next start, of leonida.exe, ran. One start each: not looked into yet, so it is not the default.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 12:10:49 -05:00
d62bf5a0a9 Launcher: Smooth Motion by default (-NoSmoothMotion: only rendered frames)
The user's call (2026-11-27): generated frames to play with while the rendered rate is under 30.
The driver's profile for leonida_sm.exe was on already; the launcher now starts that copy unless
-NoSmoothMotion is given (measurements are made with it). The rendered rate is what the window
title and the log give.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 11:40:28 -05:00
ba19ca8ada windows-boot: read the precompiled journal beside gta6rt.exe as the boot's seed (BOOT-PRECOMPILED-JOURNAL)
boot.ps1 points the runtime at <OutDir>\pipeline-cache, so a boot never read the journal that
gta6rt --precompile-pipelines writes beside gta6rt.exe and compiled those pipelines again. When
pipeline_cache.d exists there, neither the shell nor -SetEnv/KEY= set LEONIDA_PIPELINE_JOURNAL_SEED_DIR,
and the boot's own journal is a different folder (the runtime turns the journal off for a seed that
overlaps its writable journal), pass it as the read-only seed and list it in the [boot] env lines.

tests/test_windows_boot_journal_seed.py runs boot.ps1 -DryRun against a temporary runtime folder
(Windows only; nothing is launched, no game files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 17:36:00 +01:00
e2377070d3 GPU tests: give cs_pk_mul_lo_const its 128 words, keep the exit message of a dump row
cs_pk_mul_lo_const runs 32 lanes that each store 16 bytes, 128 words, but
run_gpu_tests.py and check.py ran it without VKC_OUT_WORDS, so
vk_compute_test gave it the default 64 and lanes 16-31 wrote past the
buffer through its device address (GPU-AV:
VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819). Both runners now pass
VKC_OUT_WORDS=128 (check.PK_MUL_LO_ENV), and the fixture's Run line
says so.

run_gpu_tests.py's dump rows (the bounds group, cs_heap_init,
cs_user_sgprs) showed the printed words whenever there were any. A run
that printed the right words and then exited non-zero (validation
errors) was a FAIL that showed only the expected words. dump_result now
reports "exit N: <output>" for a non-zero exit.

Found by kevincommits in the coordination issue (#1608).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 04:36:05 -06:00
dbdef2efd7 mesh-serial-waves: a GPU fixture whose two waves run loops of different length
ms_w64x_wave_loops: each wave loops while a wave-wide count is not 0, 5 iterations in wave 0 and 9 in
wave 1, so under --wave64-emulate the waves reach different numbers of workgroup barriers. Written after
stalls were reported with the serial form on an RTX 2070 SUPER (issue 1608). On an RTX 4080 (NVIDIA
621.24) it draws 4096/4096 pixels exact side by side and in series; that does not explain the stalls.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:29:50 +08:00
51799d7df6 Launcher: the Series X profile at 1440p rendered is the default; -SeriesS runs the lighter profile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 01:36:06 -05:00
fbceecf042 mesh-serial-waves: unit tests, the design row, the GPU runner's switch
tests/test_mesh_serial_waves.py: the module shape of a program that
qualifies (64 invocations, the pass loop, the index from the built-in,
the exchange's own place, per-pass copies of the exports, one
OpSetMeshOutputsEXT), that every initialised Function variable is set
again per pass, and that ms_wave_info_s3 (LDS), a 32-thread program,
native wave64 and --mesh-compute are unchanged by the flag.

LEONIDA_MESH_SERIAL_WAVES=1 is read by scripts/run_gpu_tests.py, like the
other translation switches, and no longer by rdna2spirv.py itself.
docs/design.md and docs/testing.md say what the flag does and how it is
tested; conftest gives ms_w64x_wave_votes its 128-vertex PSV0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 11:29:22 +08:00
e954dc8c16 mesh-serial-waves: a GPU fixture whose waves vote differently; no memory writes in a serial program (work in progress)
ms_w64x_wave_votes: two waves take different branches, each with its own
ballot count (and a v_readfirstlane in the second), and the triangle's
vertices come from threads 0 and 1 of the first wave and thread 64 of the
second, so ms_tri's picture needs both waves to have run their own branch
with their own votes. It passes in the side-by-side form and with
--mesh-serial-waves on an RTX 4080 (NVIDIA 621.24).

A program with a store or an atomic to memory keeps the side-by-side
form, as one with LDS does: its waves could pass each other something.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 11:13:58 +08:00
f6496d2fc2 Shaders and pipelines precompiled before the title starts; reflection guard off by default; a play build profile
Launcher (d3d12/scripts/play-nvidia.ps1, passed through by scripts/play-d3d12.ps1;
-NoPrecompile skips it): before the title starts, `leonida shaders` translates
every shader of the title's shader archive into the cache with the settings of
that start, and `leonida warm --used` makes the host pipelines earlier runs
drew with, in processes of their own. Runs write the title's pipelines down for
it (LEONIDA_PIPELINE_BOOK=1). Until now the first load of the world after a
change of the translator ran at 0.2 fps for a minute and came up half drawn
while 2,000 shaders were translated and their pipelines made. Measured here
(Ryzen 5 7600X, the machine busy with other builds): 25,663 shaders in 109 s,
226 of them with no translation (195 containers without a program, 26 wave64
programs without a 32-lane form, 5 others); 1,891 pipelines in about 150 s. A
second start finds them in the cache. The commands' log is kept quiet for the
step instead of redirected: Windows PowerShell 5.1 turns a native command's
redirected error stream into errors.

ambient.rs: LEONIDA_REFLECT_MOST is off unless set. On the renderer merged at
00698e1e8 the guard made the whole picture posterized and grey, sky and skin in
a few flat tones (run n2: all 411 recorded frames; with it off, run n3: none of
431). The program it follows is not only the reflections' there.

Cargo.toml: profile `play` (the diag build with thin LTO and one code
generation unit), to be measured against diag.

README: the table of Leonida's fixes follows the merged renderer (DLSS in place
of -Resolution native, LEONIDA_SHARPEN gone with the compose pass it lived in),
and a section on the precompile.

AI-assisted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 22:05:11 -05:00
00698e1e84 d3d12: the runtime takes trustno1-coder/VIctory-NVIDIA b190242 (CGBJ's renderer, DLSS, frame generation, F1 menu)
Upstream's four commits past 6a31e43 (5b36758, 9e7ab9d, 6395727, b190242;
GPL-3.0), brought in as a three-way merge: upstream's trees before and after
written under Leonida's names (crates leonida-*, LEONIDA_* settings) and the
difference merged onto Leonida's own changes. What comes with it, by its
authors:
- the renderer of codec-d/cool_fox f4b48ad (CGBJ) with trustno1-coder's NVIDIA
  fixes on top (residency.rs, stretch.rs, the title's upscale dispatch);
- DLSS for the title's upscale, from avatarmanz/VIctory-7900XTX pull request
  203 (feature dlss, LEONIDA_UPSCALE=dlss): the game renders its own 720p and
  DLSS takes it to 1080p on the Series S profile;
- DLSS frame generation through NVIDIA Streamline (streamline.rs, fg.rs), an
  F1 settings menu (host/menu.rs), LEONIDA_FPS_CAP, real ray tracing as an
  option (LEONIDA_BVH_BUILDER=1: the structure builder runs on NVIDIA).
NVIDIA's own files (DLSS, Streamline) are not part of the repository:
d3d12/Get-NVIDIA-DLSS.cmd fetches them from NVIDIA's GitHub into
d3d12/nvidia-sdk/ (git-ignored).

Where both sides had changed the same lines:
- compose.rs is upstream's (planes drawn by a pixel shader into the back
  buffer); Leonida's LEONIDA_SHARPEN lived in the compute pass it replaces
  and is not in this commit (DLSS has its own sharpness setting).
- draw.rs keeps Leonida's slow-beat texture re-check (300 frames by default);
  upstream's switch of the same name is dropped.
- ambient.rs keeps LEONIDA_AMBIENT_MOST and the reflection guard.
- play-nvidia.ps1 is upstream's with Leonida's defaults put back while rays
  are off: strict indirect batches (INDIRECT_BATCH=1), the light stand-in
  (AMBIENT=0.8, AMBIENT_MOST=2), ray walks ended at the root and the
  ray-resolve skip list. With upstream's defaults (stand-in off, no skip
  list) shade was black and the sky white in the world, and the card worked
  33-50 ms a frame (run n1).
- scripts/play-d3d12.ps1 follows the new launcher: DLSS by default, a shader
  cache of its own (cache-2), -NoDlss, -RayTracing, -Capture, -Log.

Builds with and without the dlss feature (cargo build --profile diag
-p leonida --features diagnostics[,dlss]). In the world on an RTX 4060 Ti 16 GB
(driver as installed) and a Ryzen 5 7600X: DLSS starts (1280x720 to
1920x1080), about 14 fps where it was 13.4. The picture is not right yet: a
posterized look in run n2 is being traced. AI-assisted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 21:48:18 -05:00
72621b80ea Leonida: NVIDIA Smooth Motion for leonida_sm.exe (scripts/smooth-motion.ps1, play-d3d12.ps1 -SmoothMotion)
The driver shows twice the frames the game renders on RTX 40/50 cards. The
script writes one per-application setting in the driver's profile store
through NVAPI (query, on, off); the setting's ID was found by
lepotane/VIctory-leonida (GPL-3.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 19:58:34 -05:00
673036bb98 Leonida launcher: native 1080p with the title's own upscaler by default
Measured on an RTX 4060 Ti, Series S profile, the user's save: 11.8 fps without
-Quality (8.3 with it); skin and bodies stayed right in every burst frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 17:29:05 -05:00
0cc6eee205 Leonida picture fixes: native 1080p, sharpening, black skin, legacy MAD, reflection guard
- play-d3d12.ps1 / play-nvidia.ps1: -Resolution native renders at the title's
  own 1920x1080 on Series S with neither title patch. A pinned render scale of
  1 with the own upscaler forced stopped the title in its init (frame 0, twice).
- compose.rs: LEONIDA_SHARPEN (0.4) sharpens the game plane before the
  interface goes over it, kept inside each pixel's neighbourhood (no halos).
- watch.rs: LEONIDA_PAGE_WRITES defaults to bits 1, 2 and 8: textures picked by
  index that were uploaded before DirectStorage or a plain read filled them are
  uploaded again (fxceless/victory-fork e4245f3: black faces and skin).
- draw.rs: LEONIDA_HEAP_RECHECK_EVERY (300 frames) keeps looking at uploaded
  textures picked by index after the fixed schedule (fxceless, after RyanCase94).
- lower.rs: v_mac_legacy_f32 / v_mad_legacy_f32 fused with flushed sources as
  RDNA 2 runs them (fxceless f6a09d3); new GPU test passes on hardware and WARP.
- ambient.rs: a reflection guard after CS_UpdateHistory (LEONIDA_REFLECT_MOST,
  3) caps reflections at a multiple of the room's light and pulls colour spikes
  to grey; the view's place from lepotane/VIctory-leonida.

Translator arithmetic and differential tests: 52 passed, 0 failed (RTX 4060 Ti).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 17:08:17 -05:00
fee07ff779 d3d12: Leonida's D3D12 runtime under its own name
What changed:
- victory/ is now d3d12/;
- its crates are leonida-* (leonida_* code paths);
- the program is leonida.exe;
- settings are LEONIDA_*, and the older VICTORY_* names still work through apps/leonida/src/leonida.rs;
- the config file is leonida.toml;
- log names and user-facing text say Leonida.

What did not change: lines that credit upstream projects or people, URLs, copyright notices and the
GPL-3.0 LICENSE. d3d12/README.md opens with a Leonida section that says the runtime grew from
Marvisak/VIctory through trustno1-coder/VIctory-NVIDIA. The rest of that README is labelled as
trustno1-coder's.

The launchers (scripts/play-d3d12.ps1, scripts/play-linux.sh), docs/linux.md and
scripts/sync_victory.py (prefix d3d12) follow the move. Future upstream merges will need a
mapping from upstream's names onto these.

Builds with `cargo build --profile diag -p leonida --features diagnostics`. The settings alias
tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 16:11:32 -05:00
010c21b7de d3d12: the runtime is leonida.exe, its window says Leonida
victory/ builds as leonida.exe ([[bin]] in apps/victory; the package keeps VIctory's name so upstream merges and cargo -p victory still work), the window caption reads Leonida, and the launchers (victory/scripts/play-nvidia.ps1 and play.ps1, scripts/play-d3d12.ps1, scripts/play-linux.sh) start leonida.exe; the Smooth Motion copy is leonida_sm.exe. VICTORY_* settings are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 16:01:44 -05:00
4d871376bf scripts: play-d3d12.ps1 starts the D3D12 runtime (victory/) on Windows
A wrapper over victory/scripts/play-nvidia.ps1: it builds victory/ (diag) when missing, keeps caches and saves under %LOCALAPPDATA%\Leonida\d3d12, and passes -SeriesX, -Quality, -Resolution, -Adapter and -More through. The Vulkan renderer stays scripts/play.ps1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:49:35 -05:00
8a73677be8 Linux: bundle VKD3D-Proton with the D3D12 runtime
On Linux the D3D12 runtime (victory/) runs under Wine. Its Direct3D 12 now comes in the package, so
players download nothing else for D3D12.
- scripts/fetch_vkd3d_proton.py puts VKD3D-Proton 3.1's unmodified 64-bit d3d12.dll and
  d3d12core.dll in the package. It also adds the LGPL-2.1 text and notice from the v3.1 tag and a
  note on where the source is. Every download is checked against a pinned SHA-256. Standard
  library only; Python 3.14 for compression.zstd.
- scripts/play-linux.sh installs the bundled DLLs into Leonida's own Wine prefix (no other prefix is
  touched) and sets WINEDLLOVERRIDES=d3d12,d3d12core=n. It runs the runtime with the measured
  NVIDIA defaults of play-nvidia.ps1.
- docs/linux.md describes the package and what is still untested: the launcher is syntax-checked
  only; it has not run on a Linux machine yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:49:02 -05:00
2d43417d49 Merge pull request #1647 from OreoFR/shader-vopcx-dpp
rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP)
2026-11-26 19:54:03 +01:00
f3628ac2e6 Ultrawide: LEONIDA_ASPECT and a pillarboxing present
- LEONIDA_ASPECT (21:9, 32:9, 43:18, any W:H or ratio from 1 to 4, or auto) widens the display mode
  the runtime reports to the title, at the same height, and widens the title's window.
- LEONIDA_PRESENT_SCALE=fit|stretch: fit keeps the frame's shape, centred with black bars. It is
  the default when LEONIDA_ASPECT is set; stretch, the old behaviour, is the default otherwise.
- The aspect math is in src/aspect_fit.h, with aspect_fit_test.
- docs/ultrawide.md describes how resolution flows from window to title to present, and what
  needs the game running: whether the title renders wider at all, its FOV and its HUD.
- play.ps1 gets -Aspect and -PresentScale.

Built; aspect_fit_test passes. The bars have not been checked on screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:04:52 -05:00
ee47019246 Improve first-run input diagnostics 2026-11-26 17:49:58 +01:00
071ec8449c address guard: the two programs set errors='replace' on stdout
tests/test_tool_stdout_encoding.py requires it of every program's __main__ block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:23:38 -05:00
6d3904860e Merge #2144 from klikso: a scripted press can be held longer, button@seconds:hold (INPUT-SCRIPT-HOLD)
Head 7bd4cec02.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:17:34 -05:00
399ecdd511 Merge #2044 from BubsMcgee: decode Opus packets through a Rust sidecar (RT-XAPU-OPUS-DECODE), with #1144 from nicoco23: xapu.dll as a command queue (RT-XAPU-CONNECT-LAYOUTS)
Head 4cfbdfc0b, which contains #1144's head 6ee7ef89b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:16:29 -05:00
1156672942 rdna2spirv: --address-guard checks every heap_base access against the runtime's page table
Every Gen.host_addr access (buffer, global_, scalar and BVH loads, stores and atomics) calls one
%guard_fn with its sign-extended 48-bit heap offset, kind and span. Below the arena's size it passes
after a compare; elsewhere the 4 KiB pages of its first and last byte are looked up in a two-level
page table (level 1 by offset bits 47..32, level 2 one bit per page). A refused load reads the zero
area, a refused store or atomic the dump area (an atomic returns 0), and the refusal is counted in
the guard header. Without the header's magic every access passes; without the flag the module is
unchanged byte for byte.

tools/address_guard.py is the Python reference of the table and the check. cs_address_guard is the
fixture of the translator test and of scripts/run_address_guard_gpu_test.py, which runs it on a heap
where every address it touches is real memory, so no run can fault.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:07:52 -05:00
7bd4cec026 gameinput: boot.ps1 names the :hold form; rewrap the script header comment
Review follow-up (MoonEyes): the InputScript help in boot.ps1 now says
each press is held 300 ms and that button@seconds:hold holds it longer.
The header comment in gameinput_script.h is wrapped at 120 like the rest
of the file. Comments only; no code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:09:17 +00:00
fad8230d77 scripts/play.ps1: start the title on the Vulkan renderer with today's working settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 03:43:47 -05:00
49fa907e4d media: a source resolver that opens local files only
The title's mfplat.dll imports bind to the host, and the host's
MFCreateSourceResolver fetches http, rtsp and other URLs over the
network. Port VIctory's media module (media.rs, GPL-3.0-or-later): a
proxy resolver that refuses anything but a local file with
MF_E_UNSUPPORTED_SCHEME (logged once per scheme and host), rewrites
console paths (GAME:, G:, T:, also as file: URLs) to their host files
through the new rt::fs::read_path, and forwards the rest to the host's
resolver. mfplat.dll stays a host module for LoadLibrary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:16:17 -05:00
c8e826a3d8 gameinput: XInput, DualSense and keyboard shim for builds without SDL3
Port VIctory's GameInput module (gameinput.rs, gameinput/dualsense.rs,
GPL-3.0-or-later) as shims/gameinput_xinput.cpp: XInput pads 0-3, a
wired DualSense over HID, the keyboard as its own device, and a keyboard
pad that stands in while no other pad is connected. Readings per change
with a 32-deep history, blocking and async device enumeration,
UnregisterCallback waiting for a running callback, FindDeviceFromId and
XInput rumble, all as VIctory runs the title.

It is built into gta6rt when the SDL3 shim is not (the main build has no
SDL3), instead of binding the import to the host's GameInput.dll, which
has no keyboard pad; LEONIDA_GAMEINPUT=host keeps that path and
LEONIDA_KEYBOARD_PAD=off drops the keyboard pad. Registered by name and
ordinal #1. gameinput_xinput_test runs it over a fake host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:12:27 -05:00
53b846f6cc ci: preserve UTF-8 test paths in redirected failure annotations 2026-11-26 00:28:22 -05:00
5943a7c6af ci: run standalone Windows tests two at a time (CI-CHECK-PARALLEL-STDLIB) 2026-11-25 23:46:12 -05:00
7b1fe62850 Keep main's watchdog switch and say where the peek default went
f0611b752 took the executable's addresses out of the code. Two behaviours
changed with it; the removal stays, the changes are now explicit:

- runtime/src/main.cpp: the watchdog kick runs again only with
  LEONIDA_TITLE_WATCHDOG=0, as on main; LEONIDA_TITLE_WATCHDOG_KICK only
  supplies the two RVAs it needs. Either variable alone leaves the
  watchdog armed and the loader says so once (before this commit the kick
  ran whenever LEONIDA_TITLE_WATCHDOG_KICK was set).
- scripts/windows-boot/boot.ps1 no longer has the game- and
  session-state RVAs built in, so LEONIDA_PEEK has no default and the
  RESULT states read "?" unless LEONIDA_GAME_STATE_RVA and
  LEONIDA_SESSION_STATE_RVA are set. The script now warns when they are
  not, and runtime/README.md (LEONIDA_PEEK, LEONIDA_TITLE_WATCHDOG and
  _KICK rows), scripts/windows-boot/README.md and docs/first_run_ui.md
  say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:55:15 -05:00
8d686309b0 Merge main into integration/boot-combined (RT-BOOT-COMBINED)
Conflict in runtime/shims/d3d12_xs_device.cpp, proxy_copy_descriptors_simple:
keep this branch's copy_null_rtv_marks call and main's fsdraw::enabled()
gate for the descriptor-copy diagnostic.

tools/rdna2spirv.py merged without a textual conflict, but #1662 on main
calls restore_dot4_inline_sel in the exact re-anchoring path, which this
branch had deleted. The merge puts main's function back so that call
resolves; the next commits reconcile it with the dot4 op_sel rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:49:53 -05:00
3edb3119fe runtime: answer the console model the title reads from the registry
The title takes its console model from HKLM\Software\Microsoft\Windows NTCurrentVersion\OEM\ConsoleMode, not from XSystemGetDeviceType alone; a PC
has no such value. registry_oem.cpp (ported from VIctory's xsystem.rs)
answers RegOpenKeyW/RegOpenKeyExW/RegQueryValueExW/RegCloseKey for that
key with 0x64 (Series X; 0x60 with LEONIDA_DEVICE_TYPE=6) and passes every
other key to the host. advapi32.dll stays a host module for LoadLibrary.

Found on the real title: its render-target pool budget (0x4000000 or
0x5200000) is picked by this model. The title still stops at its pool
check (game_scarlett_master.exe+0x247af2d): it counts the back buffers
through its XMemAlloc hooks, which Leonida does not call yet.

Tested: registry_oem (new) and d3d12_title_memory pass; gta6rt binds the
four imports to the shim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:19:40 -05:00
d9bb374655 Fix the third red check, and guard the scripts that landed since (#1561 review)
- test_tool_stdout_encoding: three scripts merged since this PR opened
  (check_compute_journal_overlay.py and compute_workers_win.py with #2098,
  corpus_watch.py with #817) get the same stdout guard as the tools here.
- test_runtime_paths: the runtime workflow's two path filters now include
  tools/conformance/**, which runtime/CMakeLists.txt names. The change is
  #1673's (xel1uz), carried here since #1673 duplicates this PR.

With it, test_tool_stdout_encoding, test_runner_calls_all_tests and
test_runtime_paths all pass on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:54:10 -05:00
3a2820b3bf Merge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)
Two conflicts:

- d3d12_com.cpp, note_direct_heap_indexing: main's console_descriptor_table_va(cbv_srv_uav_base_) for the tracked
  table, with this branch's per-site once() flag instead of note_once on every draw.
- d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile
  helper). main's dev_status::Build around the compute create moves into build_compute_pipeline, next to the
  pipeline_profile::DriverCall, so the status line still names the compute pipeline in the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:36:19 -05:00
c5f1807515 rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP)
Extend #957's DPP VOPC compare to v_cmpx: the same lane selection, with the
result written to EXEC. v_cmpx prints no destination, so src0 is its first
operand. Only the forms where every lane writes its bit are taken, as for
v_cmp. 78 pipeline-library pixel shaders of 1.0.2.1 were refused for it; all
78 now translate and pass spirv-val.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:36:00 +01:00
5baca71609 Merge port/bcpack: BCPack decoder in C++, bit-exact with VIctory's
Bit-exact with VIctory's Rust decoder on all 105,845 BCPack chunks of the
1.0.2.1 package (BC1, BC3, BC4, BC5, BC6H, BC7; 16.4 GB decoded), about as
fast on one core (59-61 MB/s against 57).

Merge resolution: gta6rt no longer compiles src/bcpack_decode_stub.cpp,
which as an object file would have silently replaced the decoder in
gta6rt_bcpack; only dstorage_xs_test links the stub now. bcpack_decode.h
keeps both sides' notes; build_runtime.ps1 lists the union of sources
without the stub.

Tested: gta6rt builds with the Vulkan device; bcpack, bcpack_tables (with
local tables) and dstorage_xs pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:32:37 -05:00
7bde974af5 runtime: port VIctory's BCPack decoder (gta6rt_bcpack, leonida_bcpack_decode)
BCPack is the console's DirectStorage codec for BC1-BC7 block streams.
src/bcpack.h and src/bcpack.cpp port victory-formats' bcpack.rs
(GPL-3.0-or-later, Marvisak and contributors) and the table loading
around bcpack::decode in victory-hle's dstorage.rs. src/bcpack_decode.h
declares leonida_bcpack_decode, the entry point the DirectStorage port
calls; the definition here replaces that branch's stub. Drop
bcpack_decode_stub.cpp when merging: a static library member is only
pulled in for unresolved symbols, so a stub left in gta6rt's sources
would win without a link error.

The format tables are not under the project's license and are never
committed: they are read on first use from LEONIDA_BCPACK_TABLES, else
bcpack-tables.bin next to the executable, and refused unless their
SHA-256 is the one VIctory's Initialize-FormatTables.ps1 pins; without
them every BCPack request fails. Decoding allocates nothing and shares
nothing mutable, so worker threads may decode at once.

Checked against VIctory's decoder (Rust, release build) on all 105,845
BCPack chunks of the user's texture pools (BC1 100,020, BC3 35, BC4 77,
BC5 325, BC6H 268, BC7 5,120; 12.1 GB packed, 16.4 GB decoded): every
output is byte-identical. One core, every 10th chunk, decode calls only:
59-61 MB/s out for the port against 57 MB/s for VIctory's build (BC1
64-66 against 62, BC7 29-30 against 27; Ryzen 5 7600X, MSVC 2022,
RelWithDebInfo).

bcpack_test (CTest bcpack) needs no game data or tables: SHA-256
vectors, table parsing and loading, VIctory's fixed BC4 stream, and
streams it encodes itself against tables of its own. bcpack_tables
repeats the checks on the real tables (SKIP, exit 77, without them) and
pins the hashes of the blocks VIctory's decoder makes of the streams it
builds; VIctory's reference_chunks test passes on those streams.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:30:15 -05:00
2daf532562 Merge port/audio: APU, DSP and audio coprocessor shims ported from VIctory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	scripts/build_runtime.ps1
2026-11-25 17:27:11 -05:00
b739685995 Merge pull request #730 from aslan2142/build589-vs-layout-census-guard
OLD-8645: restore old upstream PR 8645 - vs_layout_census: refuse a --json that is an input or a directory before survey() (BUILD-589)
2026-11-25 23:27:04 +01:00
1a3f1ebee8 port_ctl.py: name the line ending of the run log it opens
tests/test_text_write_line_endings.py requires every text writer to name
its line ending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:26:16 -05:00