Commit Graph

5744 Commits

Author SHA1 Message Date
69b21a9427 Merge origin/main (c2967a5e) into d3d90-castable-placed
Second merge round: main added rgb96 views, the device filter, the
present source-rect path and its own ctest registration of
d3d12_present_test. bind_image keeps both defaulted parameters and the
rgb96 view fallback; image_descriptor runs main's 96-bit family check
before the castable-list check; Resource keeps main's rgb96_ member;
register_samplers and the presentation plumbing follow main's positions,
and the duplicated d3d12_present_test block and stale 'surfaces' local
are dropped in favour of main's.
2026-11-22 03:15:32 -08:00
cee1ba5ac4 tests: accept a host that wraps GetResourceAllocationInfo totals past 2^64; ours stays saturated
compare_allocation_info required the host's answer for two totals that
overflow 2^64 (two 2^63 buffers; the largest buffer plus one). WARP and
the hosts of #1204 saturate at 0xFFFFFFFFFFFF0000, but the Intel Raptor
Lake-S (101.7092) and RTX 5060 Laptop (621.24) hosts on Windows
26300.9974 (D3D12Core 10.0.26100.9818) wrap, to 0 and 65536, while WARP
on the same PC saturates. d3d12_vulkan_device_test failed there on both
GPUs.

Ours is now pinned to the saturated answer, which can't make a caller
allocate less than one of its resources. A host whose total is below its
largest resource has wrapped and is reported, not compared. Any other
host answer is still a mismatch.
2026-11-22 14:14:21 +03:00
4ad7fb952f docs: f16 FMA hits the same MoltenVK helper (SHADER-182)
fma_f16_odd multiplies with a NoContraction OpFMul, so v_fma_f16,
v_fmac_f16 and v_pk_fma_f16 return +0 for a -0 product plus -0 on
MoltenVK 1.4.2 (valu_fuzz seed 330: 49/50 with the two multiply
skips, 50/50 with SPIRV-Cross 300681bb). The skip recipe now names
all five ops, and the KosmicKrisp line gives the manifest path.
2026-11-22 15:13:16 +04:00
d33d16b286 Translator: v_cvt_f16_u16/i16 and v_cvt_u16_f16/i16_f16 2026-11-22 11:11:49 +00:00
90d7ebd54b Translator: v_mad_u16, v_mad_i16 with op_sel and clamp 2026-11-22 11:09:18 +00:00
a3460331ff docs: builder command-list slots in console order; +0x490 is Barrier (slot 146)
Re-read the BVH builder's command-list call sites in the console order of section 3.5a:
+0x108 is SetComputeRootSignature, +0x138 SetComputeRoot32BitConstants and +0x168
SetComputeRootUnorderedAccessView (the PC-order readings SetComputeRoot32BitConstant,
SetComputeRootShaderResourceView and SOSetTargets do not fit the argument registers or the
inline writes). RDX at the +0xc8 call is the pipeline. +0x490 (console slot 146) is the
public enhanced Barrier with one global compute-to-compute UAV barrier.

New section 3.3a: slots 37/39/43/45 at other sites, 148 (upload allocator whose pointer is
used as the GPU address), 80 (dispatch with an extra word), 71/73 (label write/wait,
unreachable in the shipping DLL) and the second Barrier site.
2026-11-22 11:08:48 +00:00
35804cf199 Merge pull request #1404 from kovaaper 2026-11-22 06:08:14 -05:00
5ee4ff3cac Merge pull request #1403 from Nikolas Sturm 2026-11-22 06:08:14 -05:00
b1b30d8dc2 Merge pull request #1396 from Vonsek 2026-11-22 06:08:11 -05:00
016d64254f Merge pull request #1389 from Emirhan Karaca 2026-11-22 06:08:10 -05:00
ebe9df61b7 Merge pull request #1386 from liang-kai-shui 2026-11-22 06:08:09 -05:00
fa7626dbb3 Merge pull request #1384 from Dominik 2026-11-22 06:08:08 -05:00
b4d4f39e11 Merge pull request #1376 from Jolymmiles
# Conflicts:
#	docs/design.md
2026-11-22 06:08:06 -05:00
863dd448a0 Merge pull request #1373 from StebanSchrader 2026-11-22 06:08:05 -05:00
53f9e87620 Merge pull request #1367 from Vonsek 2026-11-22 06:08:03 -05:00
853a94f517 Merge pull request #1365 from AlxcBTW 2026-11-22 06:08:02 -05:00
286f5e1bbe Merge pull request #1364 from AlxcBTW 2026-11-22 06:08:02 -05:00
0edade25ff Merge pull request #1363 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 06:08:02 -05:00
0a7f9987a7 Merge pull request #1340 from Vonsek 2026-11-22 06:08:00 -05:00
54d767cb9d Merge pull request #1338 from liang-kai-shui 2026-11-22 06:08:00 -05:00
05922b71ff merge: retain the high half when saturating odd D16 image loads
Current main now preserves an odd load's leftover VGPR half. Apply the signed or unsigned range conversion before that shared half-word write so both behaviors survive the integration.
2026-11-22 12:06:27 +01:00
6e2db3d273 Merge main (c2967a5) into runtime/compute-path
main gained 117 commits since f85582e, among them #119 itself (through #908,
which is built on its head and adds PresentX on top), so both sides now
carry the presentation path: this branch as #119's own commits merged with
main at 426023a, main as #908's integration of them. Eleven hunks in six
files conflicted.

runtime/src/vulkan_present.h (2 hunks):
- present's blit: main's structure (a blank present, the source rectangle)
  with both locks of the branch. record() reads and updates the context's
  layout tracker, which ExecuteCommandLists guards with tracker_mutex_ (it
  copies the tracker, emits, and commits the copy after the submit); under
  the resource lock alone a present between that copy and that commit would
  lose its update. Order as in the context: resource -> tracker -> submit.
- presentable(): identical code, main's comment.

runtime/shims/d3d12_vulkan_device.cpp (3 hunks):
- includes: shader_library.h stays (pipelines read the translator's index);
- Resource's fields: the branch's arena fields and main's rgb96_ (D3D-62);
- standalone device: info.presentation is set once, where the swapchain
  extension is pushed (the branch's order); main set the same value later.

runtime/shims/d3d12_com.h (2 hunks): the union of the includes; the
branch's VulkanDeviceInfo::features and shader_dir stay.

runtime/CMakeLists.txt: main now builds and registers d3d12_present_test
next to xbox_present_test, so the branch's copy of that block goes; the
compute and draw tests keep theirs. d3d12_present_test keeps returning 77
without a Vulkan device, which main's registration (c2967a5) relies on but
main's test does not do yet.

README.md, docs/d3d12_vulkan.md (3 hunks): the branch's text. main's side
is what the branch had already merged at f85582e, unchanged since.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 06:03:39 -05:00
c9650fe70b tools: name Bink 2 streams from the mount lists
The RPF9 TOC is encrypted, but each pack's CDataFileMgr__ContentChangeSetDef
mount list names its videos, and the archive stores them in the list's
lowercase-path order. bink_names.py aligns the sorted list with the streams
from bink_index.py (a monotone DP that may skip list entries held by other
packs), scores header facts (resolution hints, portrait snapmatic, family
siblings sharing a shape), and labels each row verified / anchored /
bracketed / positional. Mount lists are read from an archive or an
rpf9_carve.py directory through gamedata_index, so a list split over two
zlib streams stays whole.

On 1.0.2.1 it names all 797 streams in movies.rpf, story000.rpf,
story000_restofworld.rpf and core_restofworld.rpf. Tests are synthetic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:03:33 +01:00
4bde7b4685 Merge origin/main into hw-oracle-valu (one Kernel API: lds, vgprs, sgprs)
asm.py keeps main's lds/vgprs validation, lists in metadata and the 1024 workgroup size and adds sgprs per kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:02:18 +01:00
a180cf3a10 fix(translator): read 2D level-zero samples through typed views
Nearest sampling an integer image through a float view violates Vulkan's numeric-type rule. For D16 the subsequent float-to-half conversion also destroys the sampled integers, including every texel in the synthetic signed/unsigned sum.
2026-11-22 12:00:59 +01:00
174cad2f04 Merge main into test-184-image-ops
main is at c2967a5e, 120 commits past the branch's base. Two conflicts, both
sides kept:

- docs/design.md: main added a third "Typed image loads" row at the place
  where this branch adds its "Image atomics, size and LOD queries" row. Main's
  row first, then this branch's.
- tests/test_shader_checks.py: main counts one more check (cs_fmt_xy_xyz,
  TEST-185: 2 -> 3) on the line next to this branch's comment change. Main's
  count with this branch's comment; the STORE_WORDS and GET_LOD_TESTS terms
  stay.

Nothing from main overlaps the new fixtures: TEST-185 and cs_w64x_andn2_exec
run through vk_compute_test's dump mode, and vk_store_test, vk_texture_test
and vk_compute_test are unchanged on main.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 06:00:33 -05:00
d7e1857c5d Merge origin/main into d3d90-castable-placed (resolve #1083 conflicts)
Both sides extended the same spots: the PR's castable-format flag and main's
R9G9B9E5-as-R32_UINT view emulation meet in bind_image (two extra defaulted
parameters), image_descriptor's view format (resource_format + castable list),
create_texture (TextureCreateInfo carries the VkImageFormatListCreateInfo the
castable list fills) and the device init (arena creation plus main's predication
configuration). Main's hardened CopyBuffer preparation and predicate capture
keep the PR's arena-buffer offsets; the PR's old emit-side offset math is
superseded by main's prepare-side buffer_offset handling.
2026-11-22 03:00:14 -08:00
71983deb21 fix(translator): restore typed gathers with the matching view fixture
The previous merge omitted the corrected T# and was reverted after ps_gather_wrap selected the UINT path for an UNORM image. Restore the translation only after integrating the real view format into the harness.
2026-11-22 11:59:33 +01:00
07bd05fa95 Translator: zero-based VS v0/v3 (VertexIndex - BaseVertex, InstanceIndex - BaseInstance); VS is legacy, not NGG (SHADER-33)
Corpus (scripts/vs_input_survey.py, all 2,236 VS): no exp prim, no s_sendmsg, no v_mbcnt, every
VS exports pos0/param, so the console runs them as legacy hardware VS. Their input VGPRs are
Mesa's GFX10 legacy layout (radv_shader_args.c, declare_vs_input_vgprs, not is_ngg): v0 vertex
id, v1 unused, v2 primitive id, v3 instance id; no VS reads v1/v2 on entry, 788 start with the
fetch call and read attributes from v4.

Those ids are zero-based on the hardware (ac_nir_lower_intrinsics_to_args.c: vertex_id is
load_vertex_id_zero_base, instance_id is load_instance_id; the bases come in SGPRs), while
Vulkan's VertexIndex/InstanceIndex include firstVertex|vertexOffset/firstInstance. The
translator now seeds v0 = VertexIndex - BaseVertex and v3 = InstanceIndex - BaseInstance
(DrawParameters; feature shaderDrawParameters in every VS's metadata).

GPU test vs_base_ids.asm, drawn with VKH_DRAW=16,7 (new vk_harness option): 0x101 on every
pixel, where before it was 0x7111. Run by check.py and run_gpu_tests.py. vk_harness,
vk_pipeline_check, vk_bindless_test, vk_texture_test and the runtime's Vulkan device enable
shaderDrawParameters. design.md's "Inputs and outputs" row replaces the "unverified" note.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:59:04 +01:00
53e08a76b4 Merge remote-tracking branch 'origin/main' into fma-khr
# Conflicts:
#	runtime/test/vk_test_device.h
2026-11-22 11:58:52 +01:00
70481168c8 docs/runtime_imports: which GDK runtime classes the package's modules reference
A byte search for the class and interface GUIDs xgameruntime-docs lists: XCurl.dll references XThreading,
XError and XNetworking (IXNetworkingImpl2); libHttpClient.GDK.dll holds all 24 class ids once (a linked
table), and its highest interface ids date the GDK. No other package DLL references any.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:58:12 +00:00
6f5b59ea81 runtime: serve LoadLibrary/GetProcAddress of shim-owned modules; xgameruntime.lib's run-time entry points
The package's GDK modules don't import xgameruntime.dll. libHttpClient.GDK.dll and XCurl.dll have no import
entry for it, but both carry the wide string "xgameruntime.dll" and the names InitializeApiImpl[Ex|Ex2],
QueryApiImpl and UninitializeApiImpl next to a statically linked XGameRuntimeInitialize: xgameruntime.lib's
thunks LoadLibraryW the runtime and GetProcAddress those names. Bound to the host, that bypasses the offline
shim. The executable is very likely built the same way.

- library_loader.cpp: LoadLibrary*/GetModuleHandle*/GetProcAddress/FreeLibrary for kernel32, kernelbase and the
  api-ms-win-core-libraryloader sets. A module the registry owns (rt::shims::owns_dll) gets a pseudo-handle and
  GetProcAddress resolves through the registry; an unserved name is NULL with ERROR_PROC_NOT_FOUND. Every other
  module goes to the host.
- xgameruntime.cpp: the five entry points, with the signatures and the unknown-class error documented by
  xodus-gaming/xgameruntime-docs (GPL-3.0, facts only). QueryApiImpl logs the class and interface ids and refuses
  them, so the first boot with the executable names the COM interfaces to implement.
- xgameruntime_test drives the path through XCurl.dll's api-set binding; docs/runtime_imports.md records the
  measurement and the new dry-run counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:58:12 +00:00
2dfd8d4752 fix(shader): suppress MTBUF loads from unbound descriptors
The instruction format overrides a bound descriptor. Native gfx1036 returns zeros for FORMAT=INVALID even when its address and extent are otherwise usable. Gate the existing guarded load before reading memory.
2026-11-22 11:58:00 +01:00
1c3524a078 docs/testing: say the CI-built runtime is Windows and expires
Review of #1338: the runtime-windows artifact holds Windows executables,
so say to use it on Windows or under Wine, note GitHub's 7-day expiry,
and use <unzipped runtime-windows> instead of a ~/Downloads path that
reads like Linux or macOS.
2026-11-22 18:55:19 +08:00
ca80ccb739 docs: name the affected MoltenVK builds and the workarounds (SHADER-182)
Council review: MoltenVK main at 5189f8de is affected too, the
translator claim is narrowed (SignedZeroInfNanPreserve is #664), the
counts carry their flags, and the known-problems row gives the
--skip-op and KosmicKrisp workarounds, both measured on an M3 Max.
2026-11-22 14:55:00 +04:00
0e7c60cad9 docs(i18n): remove the duplicate stale zh-CN row
The pl-PL merge (#1305) was branched before #1286 updated the zh-CN row,
so the merge kept the old 0d61c357 row next to the synced e7584c5 one.
Drop the stale row and add tests/test_i18n_index.py so the table cannot
list a language twice, point at a missing quickstart, or carry a
malformed row.

Docs and a test only, no game data.
2026-11-22 18:51:45 +08:00
05eb9ca9e2 GPU tests for the MIMG ops that had none (TEST-184)
The translator handles the image atomics, image_get_resinfo, image_get_lod
and the 32-bit image_bvh_intersect_ray, but no test ran them. Six hand-written
fixtures now do, with the expected words derived in each header from the
RDNA2 ISA definition of the instruction:

- cs_imgatomic: add, sub, and, or, xor, smin, smax, umin, umax and cmpswap on
  a 2D r32 uint image. 0xfffffff0 tells the signed min/max from the unsigned
  ones, each with a case that goes the other way; cmpswap hits and misses; one
  op runs without glc; 63 lanes are off; 64 threads add to one texel.
- cs_imgatomic3d: six cases on a 4x4x4 volume, the 3D path of the translator.
- cs_resinfo: a 16x4 image with five levels: levels 0, 1 and 3 in full, then
  dmask 0x3, 0xa and 0x8.
- ps_get_lod, ps_get_lod_array: calculated LOD 1 and 3 on the two-mip
  texture, the clamped LOD held by the last level and by the sampler's
  MAX_LOD; 2 and -3 on the one-level 2D array.
- cs_bvh32: the scene of cs_bvh through the 11-dword address form.

vk_store_test gets a "words" mode for the compute ones: it also binds the
uint image and a small volume as r32ui storage images (bindings 4 and 7) and
a 16x4 five-level image behind its real T#, fills the images and prints them;
check.py holds the expected words. The other two run on vk_texture_test and
vk_compute_test as they are.

All pass on an RX 7900 XTX and a Ryzen 9 7950X3D integrated GPU (RADV, Mesa
26.3.1) and on llvmpipe, natively and with LEONIDA_W64_EMULATE=1, and are
clean under the validation layer. No translator change was needed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 05:49:32 -05:00
2811597fd9 Merge branch 'ItsNotRexed:main' into codex/d3d97-separate-queues 2026-11-22 13:48:37 +03:00
b69eb302d0 Revert "Merge pull request #1363 from Vonsek"
#1363 picks the fetch type of explicit-LOD gathers (image_gather4_l) from the T#. With it, ps_gather_wrap fails in
both GPU runs on an RTX 4060 Ti (4096 pixels differ from the expected (5090733.0, 14942181.0, 258623.0,
9702309.0)), on main and on the PR's own branch; it passes just before the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:47:55 -05:00
4cfde416f8 Merge main (f85582e) into runtime/compute-path
On top of the merge candidate 70178d3 (Ryx69/Leonida#6, which merged main at
426023a): the 219 commits main gained since. Three hunks conflicted, in two
files; both follow the notes on #291 (ItsNotRexed 08:27 UTC, Vonsek 09:58 UTC
on 2026-11-22).

runtime/shims/d3d12_vulkan_device.cpp, device setup after the VulkanContext:
- the branch's GPU address arena is created first, as before;
- main's block that configures predication and the predicated byte copy
  (#1277) follows it;
- one load_host_image_copy call and main's lazy D24 converter (enabled only
  where D24_UNORM_S8_UINT is not usable) replace the branch's unconditional
  enable_depth24, which was the same code before main changed it.

runtime/src/vulkan_replay.h:
- CopyBuffer: main's version. It already adds ResourceBinding::buffer_offset
  to both offsets, as the branch did, and adds the overflow and overlap
  checks and the predicated copy. With the arena, source and destination are
  often the same VkBuffer; the overlap check compares the adjusted ranges.
- Predication: main's version. prepare() passes buffer_offset + the command's
  offset to prepare_predicate, so a default-heap buffer inside the arena is
  read at its own range; emit() captures the word and tests the capture's
  scratch slot, not the application's buffer.

Everything else merged without conflicts. Nothing in main's 219 commits adds
a caller that takes a buffer's Vulkan device address for its GPU VA.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 05:45:58 -05:00
ef40dbe558 docs: MoltenVK drops -0 from NoContraction multiplies (SHADER-182)
MoltenVK 1.4.2's SPIRV-Cross lowers a NoContraction OpFMul to
spvFMul, which returns fma(l, r, T(0)). A -0 product plus +0 is +0, so
valu_fuzz --family f16 reports +0 where the model wants -0 on Apple
GPUs (#1203). The translator's SPIR-V is correct. SPIRV-Cross 300681bb
fixes the helper; MoltenVK main still pins its parent.

Record the cause and the A/B measurement in the translator contract,
and add the symptom with a workaround to the known problems in
docs/testing.md.
2026-11-22 14:45:14 +04:00
244f1510c4 hw_oracle: work with 2024 HIP runtimes and LLVM 23's true16
LLVM 23 writes code object v6, which amdhip64_6.dll refuses with error
209: retry the probe as v5 and keep that version for the run.

LLVM 23 also wants v8.l for 16-bit operands on GFX11: ask the assembler
once, and use that spelling for the f16 ops the oracle's tools run.

Tested on a Radeon 780M (gfx1103), driver 32.0.11020.1002.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:38:35 +00:00
dc0cd5debc Merge main into the constant lane-mask fix
Conflicts with main's DPP and TEST-175 entries in check.py,
run_gpu_tests.py and regen_fixtures.py: main's lists with
cs_w32_mask_imm / cs_w64_mask_imm added back.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:38:22 +01:00
162211c4ca Merge pull request #1363 from Vonsek 2026-11-22 05:37:57 -05:00
1169e9e020 Merge pull request #1362 from Luv Bhargava
# Conflicts:
#	docs/design.md
2026-11-22 05:37:57 -05:00
de5c12ba53 Merge pull request #1361 from 73N1X 2026-11-22 05:37:55 -05:00
adb3482c35 Merge pull request #1347 from abilliontokens 2026-11-22 05:37:52 -05:00
ac8d66e0bd Merge pull request #1346 from ezwinxdlmao
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 05:37:52 -05:00
472166ef3b Merge pull request #1345 from AlxcBTW 2026-11-22 05:37:51 -05:00
bfe7580cbe Merge pull request #1341 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 05:37:50 -05:00