Commit Graph

18350 Commits

Author SHA1 Message Date
182d0c1746 play-nvidia: quick window finds and renderer port 2 on by default
LEONIDA_QUICK_FIND_WINDOWS: RX 6800, two sessions from a new game (runs ab-02
and ab-03, LEONIDA_AB by turns of 4 s): the frame -2.4 and -0.9 ms median.
LEONIDA_PORT_DESCRIPTORS: the boat mission (run ab-04): the frame -3.4 ms
(+-1.4) median; the player saw no flicker and no black textures.
2026-11-29 20:51:42 -05:00
b5cb6f5884 d3d12: list ahead of a frame by two threads (LEONIDA_AHEAD_SPLIT, off)
LEONIDA_AHEAD_SPLIT=1 records the list ahead of a frame as two lists at once,
the buffer views' pass on the line's thread and the textures' on one beside
it, sent in that order. On an RX 6800 (driver 32.0.21030.2001, runs ab-02 and
ab-03 by turns of 4 s) it cut the submitting thread's wait for that list
7.6 -> 4.7 ms but not the frame (-1.6 +-1.3 and +0.8 +-1.1 ms median), so it
stays off. LEONIDA_AB can switch it.
2026-11-29 20:51:41 -05:00
ff1874c6f1 d3d12: helper counts by turns (LEONIDA_VIEW_THREADS_WIDE, LEONIDA_RECORD_THREADS_WIDE)
The views' pool (4 threads, 8 wide) looks at the heap's slots for the list
ahead of each frame, 6-10 ms of the 10-14 the submitting thread stood for;
the records' pool (6, 10 wide) is the round the submitting thread waited
5-7 ms a frame for at the end of a submission (RX 6800, runs ab-01/ab-02).
The wide count is made, and how many take part follows the switch, so
LEONIDA_AB can take them by turns. Off by default; LEONIDA_VIEW_THREADS
still sets one fixed count.
2026-11-29 20:51:41 -05:00
1bb188cf52 d3d12: raw twins off 16 bytes kept with a bias the shaders add (LEONIDA_TWIN_BIAS)
A raw twin of a buffer view that does not begin on 16 bytes was to be moved
there by move_raw. On an RX 6800 (driver 32.0.21030.2001) the CPU descriptor
handles hold host pointers, not hardware descriptors, so move_raw never
applied and every unaligned twin was made null: 165-726 a frame, and the
programs that read them (the vegetation's data) read zeros.

Now such a twin is made from the multiple of 16 before its view, and the
bytes it begins early by go in bits 24..27 of the slot's stride word
(VIEW_BIAS_MASK), which translated programs add to their offsets through the
table of strides. In gameplay: 0 null and up to about 1,100 biased a frame.
Whether the foliage flicker is gone is not yet confirmed by the player.
LEONIDA_TWIN_BIAS=0 makes them null as before (programs add a bias of 0).

Tests: twin_bias_tests (the bias read from the table of strides, accesses
through twins beginning where the view does) and, in listed_raw_tests, the
off-alignment readback with the bias and a dump of buffer view descriptor
bytes.
2026-11-29 20:51:40 -05:00
605379ac6a Probe off-alignment per-list raw buffer views offscreen
Reproduce the null SRV in cold and cached per-recording descriptors, and compare an aligned public D3D12 SRV/UAV pair with explicit offsets. Inspired by singlag 02c889ff.
2026-11-29 20:51:17 -05:00
7d76dee8af tests: call xr.run_result in x64_recomp QEMU fallback runners (TEST-X64-RECOMP-QEMU-RUNNER) 2026-11-29 19:47:41 -06:00
fb163d9a9c scripts: launch Windows compute workers with sys._base_executable (COMPUTE-WORKERS-WIN-VENV) 2026-11-29 19:46:20 -06:00
6ce261718a deps: bump third_party/rpf9-explorer from e293917 to 73e9400
Bumps [third_party/rpf9-explorer](https://github.com/breadbbbb/rpf9-explorer) from `e293917` to `73e9400`.
- [Release notes](https://github.com/breadbbbb/rpf9-explorer/releases)
- [Commits](e2939175c3...73e940075c)

---
updated-dependencies:
- dependency-name: third_party/rpf9-explorer
  dependency-version: 73e940075cc4d113252b5271bf0d83b1b014042a
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-30 01:21:35 +00:00
40e7fe69da Merge pull request #2665 from aslan2142/ci/cleanup-main-workflows
ci: fix runtime/windows timeout, remove redundant CI legs, and harden caches
2026-11-30 02:20:51 +01:00
d2befefad7 ci(runtime): keep windows ctest serial to avoid 4-vCPU starvation in xmem/silent_audio 2026-11-29 20:06:24 -05:00
18936010df chore: remove dead Tier 1 files, wire 5 unwired C++ tests, and fix play.ps1 path 2026-11-29 20:00:40 -05:00
0eab02a8bc Terrain mesh dispatches run their X with Y, Z of 1; three particle emitters paired; latency from present to present
- Indirect mesh dispatch records run as [X, 1, 1], as the console reads them (X alone). The terrain's tessellation
  writes (X, 0, 0), which D3D12 drops: the near ground was in depth but missing from the G-buffer, black with white
  specks on dirt and sand edges up close. The single clamp (indirect.rs), the batched one (indirect/batch.rs) and the
  bench's (indirect/bench.rs); unfilled slots (X past 65,535) still run empty. From VIctory-NVIDIA 216bca9
  (invismann), through voidopcode/vilocity 41bccf0 (GPL-3.0-or-later). Tests on WARP:
  warp_window_leaves_unfilled_slots_empty_and_uncharged feeds (519, 0, 0); warp_batch_clamps_as_the_clamp_of_one_does
  checks [X, 1, 1] for every mesh record; both pass.
- Launcher: the model emitters CS_Emit_Dynamic_Model_Skinned, _AttachMesh and CS_Emit_Dynamic_Model (particles from
  a character's body) take the paired form (LEONIDA_PAIRED_FOR); translated alone none translates for 32-lane host
  waves and all three do paired. After voidopcode/vilocity 324fe01, 4244b51.
- Launcher: the files of NVIDIA's shader cache a precompile writes are noted; if one is gone at the next start (the
  cache emptied by hand, or a full one moved aside) the pipelines are made again instead of being compiled in the
  game (runs d76, d96: up to 480 ms a frame waiting for pipelines).
- The line: "frames waited from the title's present to ours" each second (after vilocity c04fdd7): the latency the
  line adds between the title and the screen.
- findings: the frame rate measured against the PC's own load (a restart brought back background programs: 17.3 ->
  12.8 frames a second for one build); LEONIDA_WRITE_SITES measured on/off/off/on: faults -1,000 a frame, the frame
  unchanged, left unset.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:00:09 -05:00
ee9fb09755 d3d12: lower depth_bounds_pipeline_loads_and_filters_draws to SM 6.0
Compile the synthetic shaders in depth_bounds_pipeline_loads_and_filters_draws
as vs_6_0/ps_6_0 and check device_supports_depth_bounds_sm60 so running
with LEONIDA_D3D12_WARP=1 on Windows 10 22H2 (WARP max SM 6.2) succeeds
cleanly.

Refs: #2570

AI-assisted.
2026-11-29 16:44:29 -08:00
4ae05e76c0 PlayStation glyphs: --mono, a look close to the PS5's prompts; the DualSense d-pad; no box behind a glyph
- `--mono` draws white keys and discs with black symbols, as the PS5's own button prompts look.
- In that look the d-pad is the DualSense's: four separate arrow keys pointing at the middle,
  the pressed ones white and the rest grey (all white for the plain d-pad and for all four).
- Mono sprites have no see-through bounding box behind them: when a menu highlights an option,
  the title's colour change showed that box as a black halo around the glyph.
- tests: no box behind any glyph in the mono look, the d-pad's key colours, the mono movie builds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-29 18:32:16 -06:00
c65f657c45 d3d12: compile parallel depth-bounds test at SM 6.0 and decouple WARP/host passes
Lower the standalone parallel depth-bounds regression test's synthetic
shaders from vs_6_5/ps_6_5 to vs_6_0/ps_6_0 so Windows 10 22H2 WARP
(max SM 6.2) supports them, gate each device independently on
DepthBoundsTestSupported + D3D_SHADER_MODEL_6_0, and deduplicate by
adapter LUID so skipping WARP never skips hardware coverage.

Refs: #2570

AI-assisted.
2026-11-29 16:31:10 -08:00
3209231b3d ci: satisfy jactionlint default profile (pipefail shells and dependabot cooldown) 2026-11-29 19:30:03 -05:00
b425746ffa Merge remote-tracking branch 'origin/main' into fix/d3d12-depth-bounds-test-flake 2026-11-29 16:28:56 -08:00
f9d9312241 Merge remote-tracking branch 'origin/main' into perf/d3d12-gpu-alias-cast-r9g9b9e5 2026-11-29 16:26:10 -08:00
8aaf91fd91 test(d3d12-gpu): serialize alias_cast_tests root signatures explicitly for Wine
D3D12-ALIAS-CAST-R9G9B9E5
Wine's builtin d3dcompiler_47 ignores HLSL [RootSignature(...)] attributes,
causing CreateRootSignature from shader bytecode to fail with E_FAIL when
running alias_cast_tests without native d3dcompiler_47.

Remove [RootSignature(...)] from alias_cast_tests HLSL test shaders and
serialize each test root signature explicitly with D3D12SerializeRootSignature
(D3D_ROOT_SIGNATURE_VERSION_1) via serialize_root/compile_cs.

AI-assisted.
2026-11-29 16:26:09 -08:00
b8bd371116 Image stores keep infinities; a loader relocation fix; the texture hash backoff switch; key-to-frame stamps
- Translator: with LEONIDA_NAN_SCRUB=1 the floats an image store writes keep an infinity, as on the console, and
  only NaN becomes 0 there (LEONIDA_NAN_SCRUB_STORE_INF=0: held at 65504 as before). The water's plain transmission
  volumetrics store an infinity for "no surface along this ray"; held at 65504 it was a surface 65 km off (a black
  disc toward the sun). After voidopcode/vilocity 767369a (GPL-3.0). Colours a pixel program writes are held as
  before. Test the_nan_scrub_keeps_the_integer_bits_an_image_store_writes (card and WARP) updated; it passes.
- Loader: dir64_relocations reads whole entries of a block only and no page whose entry's place passes 4 GiB
  (after edsuuu/VI-BR-PORT df2b835d7); test a_malformed_relocation_block_gives_nothing.
- Textures: LEONIDA_TEXTURE_HASH_BACKOFF (off unless asked; by turns under LEONIDA_AB): a guarded texture whose last
  4 looks behind the guard found it as it was takes one of every 16 of its turns (after kylepelham/El1xr d9fc89a4,
  GPL-3.0). A frame hashed 38 to 40 MB of such textures and found 0.0 changes the guard had not seen (run d69).
  Test a_quiet_texture_takes_one_turn_in_n.
- Diagnostics: a recorded frame's present time (frames-times.txt in the capture folder) and a log line when the
  scripted keys change, for the time from a key to the first frame that shows it.
- findings: the busiest faulting stores are the kind LEONIDA_WRITE_SITES rewrites; its notes are keyed by the
  executable's hash.

Four recorded tours with this build (runs d76, d77, d87, d96): no one-frame dark floor, no white flash; the plain
tour on a cleared driver cache (d96) has no one-frame glitch at all.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 19:21:03 -05:00
129c840089 ci: fix runtime/windows timeout, remove redundant CI legs, and harden caches 2026-11-29 19:17:38 -05:00
51ea09bf53 d3d12: fix WARP bypass and parallel descriptor contention in depth-bounds PSOs
When DepthBoundsTestEnable is true with DepthEnable and StencilEnable false,
Microsoft WARP bypasses the depth-stencil stage completely and passes
fragments even when the depth buffer value lies outside [MinDepthBounds,
MaxDepthBounds].

Normalize host D3D12_DEPTH_STENCIL_DESC1 in pipeline::host so pipelines with
DepthBoundsTestEnable && !DepthEnable and a non-UNKNOWN DSVFormat enable
DepthEnable with D3D12_COMPARISON_FUNC_ALWAYS and D3D12_DEPTH_WRITE_MASK_ZERO
(a mathematical no-op on depth comparison and writes, valid on read-only DSVs
as well), exclude depth-bounds passes from GraphicsState::screen_pass, and
isolate RTV/DSV descriptors and pre-cut clears in
depth_bounds_pipeline_loads_and_filters_draws alongside a 4-thread parallel
WARP + hardware regression test.

Refs: #2570

AI-assisted.
2026-11-29 16:10:59 -08:00
ab78da3718 Merge origin/main into fix/d3d12-shader-paired-water-and-wave64
Integrates multi-wave barriers_on_every_way, _rtn paired LDS atomics, ds_cmpst_rtn_b32, and ds_sub_u32 compare-exchange loops alongside multi-dword/sub-dword paired LDS, default LEONIDA_LOOPS_WAVE=1, monotone fixpoint lane_regions, partial_active host_wide masking, and Sym::Own lane provenance.

AI-assisted.
2026-11-29 16:00:29 -08:00
fdfe5ccbfc fix(d3d12-gpu): flush batched listed copies before stale R9G9B9E5 rebuild
D3D12-ALIAS-CAST-R9G9B9E5
- Call flush_listed() in HostHeap::make_listed before overwriting a stale
  views.slot(at) descriptor so deferred LISTED_COPIES (LEONIDA_BATCH_DESCRIPTORS=1)
  from earlier slots complete before the scratch slot is rewritten or nulled.
- Check TEST_ALIAS_CAST in alias_cast_create() so alias GPU tests stay hermetic
  when LEONIDA_ALIAS_CAST=0 is set in the environment.
- Add D3D12 debug-layer GPU test covering queued make_listed copies across
  mid-table VA replacement under batch_descriptors().

AI-assisted.
2026-11-29 15:54:27 -08:00
214f7bfa7f perf(d3d12-gpu): extend R9G9B9E5 relaxed format casting to CreatePlacedResource2
D3D12-ALIAS-CAST-R9G9B9E5
Merge origin/main and extend R32_UINT/R32_SINT -> R9G9B9E5_SHAREDEXP
relaxed format casting across both ID3D12Device10::CreateCommittedResource3
and ID3D12Device10::CreatePlacedResource2 (pool::texture_with_cast + ID3D12Device12
GetResourceAllocationInfo3) using D3D12_BARRIER_LAYOUT_COMMON and
&[DXGI_FORMAT_R9G9B9E5_SHAREDEXP] while keeping legacy D3D12_RESOURCE_STATES
transitions everywhere and leaving host.rs untouched.

Fold view_cast_serial into draw::entry_once keys and add D3D12 debug-layer
GPU tests covering both committed and placed 2D, 2D-array, and 3D R32_UINT
textures written via UAV and sampled in place as R9G9B9E5_SHAREDEXP.

AI-assisted.
2026-11-29 15:45:08 -08:00
20174a9405 Merge ProjectLeonida/mandy main into port/nv-vram-target-reserve-settle
# Conflicts:
#	d3d12/README.md
2026-11-29 23:20:23 +00:00
f0703cdef4 rdna2spirv: check high 32 bits for buffer offset fit to avoid NVVM crash
In Gen.buffer_address (tools/rdna2spirv.py), emit
`OpShiftRightLogical %ulong wide %c64_32` followed by
`OpIEqual %bool hi_w %cl0` instead of
`OpULessThanEqual %bool wide %clffffffff`.

NVIDIA 580.82.07 NVVM aborts pipeline creation (`NVVM compilation failed: 3`,
VkResult -13) on the unsigned 64-bit compare when a literal V# folds `wide`
to `0 + idx * stride` (reported and A/B-tested on L4 by @kevincommits in
ubiquitarianism/leonida#1608#issuecomment-7208330785). Over uint64,
`(wide >> 32) == 0` is mathematically identical to `wide <= 0xFFFFFFFF`.

Since lower_addr64 (SHADER-423), the 64-bit compare still reaches the driver
with --int64-addresses, and by default in any module the lowering leaves in
its Int64 form (a 64-bit scalar op such as s_lshl_b64 elsewhere in the
shader). Where the lowering does apply, the new form lowers to a high-word
`== 0` test, without the pair compare's redundant low-word
`<= 0xFFFFFFFF` term.

tests/semantic/test_buffer_offset_wrap.py runs every access (including the
exact 32-bit boundary cases: `0xFFFFFFFC` dword, `0xFFFFFFFF` byte vs
`0x1_0000_0000`) three ways: lowered (default), --int64-addresses, and
default with Int64 kept. It checks that no compare with the 32-bit limit is
emitted in any of them (raw and after spirv_opt.optimize), that the Int64
forms test `(wide >> 32) == 0`, and that the modules pass spirv-val when it
is on PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:09:38 +10:00
1786d7ad5b docs: table of which imported GDK names have a public page (DOCS-GDK-PUBLIC-PAGES)
Measured 2026-11-29 by HTTP against the public docs.xbox.com index and
Microsoft Learn; page contents not read, nothing copied from the GDK.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 23:43:34 +01:00
452d1d1b68 Merge remote-tracking branch 'origin/main' into next 2026-11-29 17:09:32 -05:00
dc64c3685f Six list threads by default; findings: the title's stores that change nothing, the aliased views' copies
- play-nvidia.ps1: LEONIDA_THIN_THREADS=6. Two of eight list threads parked by turns of 4 s (LEONIDA_THIN_PARK),
  standing at one save, two runs: the frame's median -0.83 +-0.16 ms (d69) and -0.94 +-0.52 (d73), the
  submitting thread -0.49 +-0.12 and -0.74 +-0.62.
- findings: the fault handler is entered 2,400 to 2,950 times a frame, of which some 2,000 are single stores done
  beside the guards, most of them storing what the memory already holds; the loader's rewrite of such places
  (LEONIDA_WRITE_SITES) is not set by the launcher and is the next thing to measure.
- findings: the copies behind aliased views could go with relaxed format casting (driver 616.64 has it).

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:09:28 -05:00
32b9f4a3e0 Merge pull request #2649 from DadaCap/fix/sample-locations-msaa-only
runtime: programmable sample positions only for multisampled targets, so 1x depth images stay plain (RT-SAMPLE-LOCATIONS-MSAA-ONLY)
2026-11-29 23:03:09 +01:00
22e1349d78 test(submit_frame): yield until steady_clock advances in WorkerScope check 2026-11-29 16:50:39 -05:00
d1539971a9 runtime: programmable sample positions only for multisampled targets (RT-SAMPLE-LOCATIONS-MSAA-ONLY)
#778 filled the sample-locations grids from 1 sample upwards, so every 1x depth-stencil image was created
sample-locations compatible and carried sample locations through its transitions. D3D12 only has programmable
sample positions for multisampled targets; since #778 the world phase loses the device on an RTX 5080. Keep 1 sample
out (SamplePositions::programmable_count): 1x depth images are plain again, MSAA keeps the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwPPpwX5RYWwXCnj43U
2026-11-29 22:43:46 +01:00
eade9562c1 tests: raise kHeavyTurns in vk_gpu_profile_test and synchronize lock_timed holder in submit_frame_test 2026-11-29 16:17:10 -05:00
060c471604 Merge pull request #1730 from efeekrb/claude/vibrant-tesla-g37dow
docs/boot_leads: say which leads are done and which have open pull requests (DOC-BOOT-LEADS-STATUS)
2026-11-29 22:13:17 +01:00
a84c41909b Merge pull request #1823 from Ch1mpleo/carry/old-9895
docs: document LEONIDA_RNG_SEED in runtime/README.md (OLD-9895)
2026-11-29 22:13:06 +01:00
345da0378d Merge pull request #2490 from thiefyzheng/fix/design-md-duplicated-rows
docs/design: de-duplicate the s_bfe contract-table row
2026-11-29 22:12:56 +01:00
ed089a96ae Merge pull request #1217 from robot00f/docs/ctest-hosts
docs: the runtime ctest suite by host, Wine against native Windows, on one Pascal card (#1150)
2026-11-29 22:12:47 +01:00
f359be5e6b Merge pull request #1125 from robot00f/docs/b1
docs(d3d12_vulkan): measured presentation slots 78-81 (D3D12-PRESENT-SLOTS-MEASURED)
2026-11-29 22:12:39 +01:00
255b6752ce Merge pull request #1056 from robot00f/docs/d3d12-other-pages-consistency
docs: align the other pages with the measured CreateDevice block size and slot 62/76 (D3D12-OTHER-PAGES-CONSISTENCY)
2026-11-29 22:12:30 +01:00
7bbc1d223b Merge pull request #608 from TuroYT/ci/xma2-concurrency
ci: add a concurrency group to xma2-decoder.yml (CI-XMA2-CONCURRENCY)
2026-11-29 21:41:55 +01:00
4f63764c14 Merge pull request #1404 from milk4sale/ci/check-time-limit
ci: give the Windows check job 30 minutes; it needs 21 and was cancelled at 15 on every run (CI-CHECK-TIME-LIMIT)
2026-11-29 21:41:49 +01:00
ea171c2a17 Merge pull request #1462 from milk4sale/ci/semantic-windows-time-limit
ci: give the Windows semantic-tests leg 20 minutes; it was cancelled at 10 in 14 of 23 runs (CI-SEMANTIC-WIN-TIME-LIMIT)
2026-11-29 21:41:43 +01:00
1d0867c4a7 runtime: zero-init TargetView trailing padding and allow clamped 0 ms graphics interval in vk_gpu_profile_test 2026-11-29 15:27:45 -05:00
71db4c4051 test(semantic): align computed-I/J f16 interp oracle with toward-zero p2 narrow
Update `tests/semantic/test_interp_computed_ij_fallback.py` (#2239) to
narrow `v_interp_p2_f16` reference expectations toward zero (`f16_rtz` /
`f16_rtz_bits`), matching `SHADER-468` (#1181).

AI-assisted.
2026-11-29 15:19:48 -05:00
edf0ff5d02 Merge pull request #2631 from MoonEyes/docs/readme-index-missing
docs: index the 11 pages missing from docs/README.md (DOCS-README-INDEX)
2026-11-29 21:17:53 +01:00
c2a7261969 Merge pull request #2630 from MoonEyes/docs/gdk-public-reference
docs: how to use the public PC GDK to write shims (DOCS-GDK-PUBLIC-REFERENCE)
2026-11-29 21:17:33 +01:00
fcc044cdc4 Merge current main after CI fixture fixes 2026-11-29 21:07:01 +01:00
eddf401a2f Merge main into fix/d3d12-gpu-pipeline-bytecode-alignment 2026-11-30 04:03:47 +08:00
720bd3b4e1 Merge pull request #2629 from MoonEyes/fix/ci-main-empty-spv-fakes
tests: bvh and exe shader-stage fakes write non-empty modules (CI-MAIN-EMPTY-SPV-FAKES)
2026-11-29 20:59:48 +01:00