Commit Graph

1558 Commits

Author SHA1 Message Date
2dc3ac3447 Merge pull request #1754 from Jan Trencansky 2026-11-22 09:15:06 -05:00
b78819439f Merge pull request #1753 from Serrambi 2026-11-22 09:15:05 -05:00
12e9e7b08f Merge pull request #1750 from shoal-rat
# Conflicts:
#	docs/design.md
2026-11-22 09:15:04 -05:00
d5b68b77dc Merge pull request #1746 from Youssef Rahmouni
# Conflicts:
#	docs/design.md
2026-11-22 09:15:02 -05:00
445e79b2c7 Merge pull request #1743 from romainveurrier 2026-11-22 09:15:00 -05:00
c0c0e8d98d Merge pull request #1741 from Kam471 2026-11-22 09:14:59 -05:00
da574cb90e Merge pull request #1714 from SWAYAM 2026-11-22 09:14:53 -05:00
e74cd75d0b Merge pull request #1686 from Shadman PC 2026-11-22 09:14:50 -05:00
2a30f92d29 Merge pull request #1653 from Felix Croasdale
# Conflicts:
#	docs/testing.md
2026-11-22 09:14:49 -05:00
403104124c Merge pull request #1534 from Kam471 2026-11-22 09:14:46 -05:00
be71c447bb Merge pull request #1449 from Kam471 2026-11-22 09:14:44 -05:00
af236e196b d3d12_xs: route slot 67 compute pipeline from native code to CreateComputePipelineState (RT-99)
Xbox device slot 67 takes (desc, riid, out) with IID_ID3D12PipelineState and a console-only
descriptor with the root signature at +0x00 and code blob pointer/size at +0x28/+0x30.
Previously it logged and returned E_NOTIMPL.

Route it to CreateComputePipelineState on the PC device (slot 11) like slot 62, mapping the
console descriptor to D3D12_COMPUTE_PIPELINE_STATE_DESC. On the Vulkan device this resolves
through the translator via fssm_program and ShaderLibrary.

- Implement proxy_create_compute_pipeline_from_native_code in d3d12_xs_device.cpp
- Update device_proxy_test to verify slot 67 thunk, compute PSO creation over WARP, and argument checks
- Update d3d12_compute_test to verify slot 67 compute PSO creation on the Vulkan device
- Update documentation in d3d12_command_objects.md and d3d12_vulkan.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:34:10 +05:30
af0453281d d3d12: support multisampled placed textures (D3D-222) 2026-11-22 15:02:35 +01:00
912a6aaf50 rdna2spirv: keep --f16-interp-fallback halves at location 29 and below (SHADER-291)
MoltenVK reports maxVertexOutputComponents = 124 because Metal counts
gl_Position in its 128 vertex-output scalars, and the validation layer
counts it too. With param 0's high halves at location 30, every VS that
exports a param under --f16-interp-fallback (on by default on MoltenVK)
failed VUID-RuntimeSpirv-Location-06272. Move the halves down one
location so the top one is 29 ((29 + 1) * 4 + 4 = 124).

Update the design.md contract row and the semantic test, which now also
checks the boundary (param27 keeps param 0's halves, param28 drops them)
and that no VS output goes above location 29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:50:07 +08:00
15359fba38 SHADER-137: RDNA2 hardware integer probe and gfx1035 measurements (wave32 & wave64) 2026-11-22 14:47:29 +01:00
17b36d7604 docs: attribute the 26,503 shader result to dcd8ecf, not the 26,501 run 2026-11-22 13:46:18 +00:00
f5b198404e docs/testing.md: one overlay-layer row, with the elevated-terminal cause (TEST-228 follow-up)
#1653's first commit and #1656 both landed, leaving the Known-problems
table with the implicit-layer row twice and two overlapping overlay
rows, and the validation paragraph saying the overlays ignore
VK_LOADER_LAYERS_DISABLE=~implicit~. Per @Rainmaker33's loader log, they
only stay in when the terminal is elevated: the loader ignores
VK_LOADER_LAYERS_DISABLE with administrator rights, while each layer's
disable_environment switch still works, and RTSS adds the STORAGE usage
only while RivaTuner Statistics Server runs. Keep one implicit-layer row
and one overlay row that say so, and correct the paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:43:49 -06:00
7ffe3a93b4 Translator: v_dot4_i32_i8 and v_dot4c_i32_i8, confirmed on RDNA2 hardware
The 29 FSPX programs of the upscaler DLL use the two signed-byte dot products 27,271 times, all in 13 programs,
and the translator had neither. The rule: the sum of the four products of the sign-extended bytes of two dwords,
plus the third source (v_dot4_i32_i8) or the destination's old value (v_dot4c_i32_i8), modulo 2^32.

Confirmed on gfx1036 with raw kernels through tools/hw_oracle: 10 operand sets, both instructions, both source
orders of the accumulating one. Two modifiers were measured and are refused: clamp saturates to a signed 32-bit
value, and op_sel 2 with op_sel_hi 5 (the 89 words llvm-mc does not decode) exchanges the 16-bit halves of the
second source. The measured words are the tables of tests/semantic/test_alu_dot4_i8.py.

With tools/fspx_unpack.py on version 1.0.2.1: 17 of the 29 programs translate and pass spirv-val, 13 before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 08:41:38 -05:00
fa2712e2b0 xdxr_build: one-workgroup sort for small builds, 256-element radix tiles
The radix sort's fixed latency dominated small builds (2,000 triangles: 0.81
ms with the sort, 0.08 ms without, on an RTX 2050; the 10k regression
@exhawk measured on #1572). Up to 1,024 keys are now sorted in one
workgroup's shared memory (bitonic, ties by element index: the stable
order; 8 KiB, within the 16 KiB minimum with the radix arrays), and the
radix tiles are 256 elements (4 chunks instead of 32 per workgroup).

RTX 2050: 1,000 triangles 0.24 ms, 2,000 0.28 ms (0.83), 10,000 0.38 ms
(0.81), 100,000 2.3 ms (2.5); 1M 21.9 ms (20.3, the larger scan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:41:25 +01:00
00af470cf5 perf(translator): fold constant scalar ALU operations and s_buffer_load descriptor bounds
In RDNA2 shaders, constant calculations and scalar descriptor bounds checking
occur frequently across compute and graphics stages.

- Fold constant scalar ALU operations (s_and_b32, s_or_b32, s_xor_b32, s_not_b32,
  s_lshl_b32, s_lshr_b32, s_mul_i32) into immediate constants and constant SCC
  writes at translate time, eliminating runtime OpBitwise*, OpShift*, OpNot, and OpIMul.
- In s_buffer_load (SMEM), evaluate limit = NUM_RECORDS * stride at compile time
  when descriptor words 1 and 2 are known in sgpr_imm, eliminating 6 runtime SPIR-V
  instructions (OpBitFieldUExtract, OpUConvert, OpIMul, OpIEqual, OpSelect).
- When offset and limit are constants, fold per-dword bounds statically: in-range
  dwords emit straight-line OpAccessChain and OpLoad without branch diamonds
  (OpSelectionMerge, OpBranchConditional, OpPhi), and out-of-range dwords emit
  constant zero without issuing memory loads.
- When scalar load offset is passed via an SGPR with known literal, fold into
  immediate constant without runtime OpBitwiseAnd, OpUConvert, and OpIAdd.
- Updated docs/design.md with static bounds folding behavior.
- Added tests in tests/semantic/test_scalar_alu_and_smem_folding.py covering all cases.
2026-11-22 19:38:54 +06:00
4925b00ca7 docs: say +0x0C was measured on 0.5% of the corpus 2026-11-22 13:38:47 +00:00
3eea991891 Merge pull request #1722 from Sanonymous01 2026-11-22 08:38:46 -05:00
5056ee85a2 audio: emit the Opus EOS page at the trim point, not the last page
Clamping only the last page's granule made it smaller than the previous
page's when the trim target fell before that page started: a 27-packet
real-libopus fixture declared 24,000 frames but decoded 24,960, and the
Ogg granule went 24,960 -> 24,000. Emit the EOS page at the first packet
that reaches pre_skip + length and drop the remaining padding packets.

Also require +0x0C to agree with the interleaved +0 count before using
it, and clamp an oversized pre-skip to the stream length so the final
granule never falls below it.

Measured on real streams: with pre-skip 0, the 5%/10% attack point is
312 samples (30 streams from four banks, median 312; the 10% point ranges
278..868, none near 1920), so the default is measured, not just assumed
from libopus. 20 real streams at 48 and 32 kHz now decode to exactly
their declared counts.
2026-11-22 13:38:46 +00:00
8240b17b8a Merge pull request #1716 from Gino
# Conflicts:
#	docs/design.md
2026-11-22 08:38:44 -05:00
0a244274f8 Merge pull request #1715 from Artur
# Conflicts:
#	docs/design.md
2026-11-22 08:38:42 -05:00
230c0f63dc Merge pull request #1711 from Taffyyy-ops
# Conflicts:
#	docs/design.md
2026-11-22 08:38:40 -05:00
089c124df3 Merge pull request #1704 from Jack UK 2026-11-22 08:38:35 -05:00
10cf6ffca6 Merge pull request #1699 from AimLogin
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:33 -05:00
464cff7336 Merge pull request #1698 from Jan Trencansky 2026-11-22 08:38:32 -05:00
70abc4c5c1 Merge pull request #1697 from BetterJdue 2026-11-22 08:38:31 -05:00
1ba91fc66e Merge pull request #1694 from ZazaJr24 2026-11-22 08:38:30 -05:00
aa0e06fbac Merge pull request #1686 from Shadman PC
# Conflicts:
#	docs/design.md
2026-11-22 08:38:26 -05:00
7e75f3dddb Merge pull request #1685 from bobcatchris
# Conflicts:
#	docs/design.md
2026-11-22 08:38:25 -05:00
73c88c6ee2 Merge pull request #1682 from nonverifiedperson 2026-11-22 08:38:22 -05:00
e2af5b7df7 Merge pull request #1674 from Serrambi 2026-11-22 08:38:19 -05:00
5ea08e98a1 Merge pull request #1673 from Luiz Neves 2026-11-22 08:38:19 -05:00
e6b940e5b3 Merge pull request #1672 from Nethmina Yasas 2026-11-22 08:38:18 -05:00
a9c0d3bfb9 Merge pull request #1659 from Anira
# Conflicts:
#	docs/design.md
2026-11-22 08:38:17 -05:00
ab8eeda70f Merge pull request #1653 from Felix Croasdale
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:15 -05:00
418678829b Merge pull request #1566 from AlxcBTW
# Conflicts:
#	docs/related_projects.md
2026-11-22 08:38:05 -05:00
42512eec28 Merge pull request #1549 from tylerstraub 2026-11-22 08:38:03 -05:00
b0fb4923a8 Merge pull request #1539 from Luiz Neves 2026-11-22 08:38:02 -05:00
4139be0d80 Merge pull request #1534 from Kam471 2026-11-22 08:38:02 -05:00
bb0ecfc089 Merge pull request #906 from AlxcBTW 2026-11-22 08:37:59 -05:00
aee81b80ef Merge pull request #759 from Douglas Sposito 2026-11-22 08:37:59 -05:00
b7201d7147 Merge pull request #616 from SirAmong
# Conflicts:
#	docs/design.md
2026-11-22 08:37:58 -05:00
61a664bee7 docs: scope the Mandy negative to this 108-file package 2026-11-22 13:37:54 +00:00
931e676018 perf(translator): fold constant scalar ALU operations and s_buffer_load descriptor bounds
In RDNA2 shaders, constant calculations and scalar descriptor bounds checking
occur frequently across compute and graphics stages.

- Fold constant scalar ALU operations (s_and_b32, s_or_b32, s_xor_b32, s_not_b32,
  s_lshl_b32, s_lshr_b32, s_mul_i32) into immediate constants and constant SCC
  writes at translate time, eliminating runtime OpBitwise*, OpShift*, OpNot, and OpIMul.
- In s_buffer_load (SMEM), evaluate limit = NUM_RECORDS * stride at compile time
  when descriptor words 1 and 2 are known in sgpr_imm, eliminating 6 runtime SPIR-V
  instructions (OpBitFieldUExtract, OpUConvert, OpIMul, OpIEqual, OpSelect).
- When offset and limit are constants, fold per-dword bounds statically: in-range
  dwords emit straight-line OpAccessChain and OpLoad without branch diamonds
  (OpSelectionMerge, OpBranchConditional, OpPhi), and out-of-range dwords emit
  constant zero without issuing memory loads.
- When scalar load offset is passed via an SGPR with known literal, fold into
  immediate constant without runtime OpBitwiseAnd, OpUConvert, and OpIAdd.
- Updated docs/design.md with static bounds folding behavior.
- Added tests in tests/semantic/test_scalar_alu_and_smem_folding.py covering all cases.
2026-11-22 19:35:54 +06:00
64d41a89a6 Translator: v_sin/v_cos reduce with x - RoundEven(x), contract row and GPU test (SHADER-88 follow-up to #1283)
#1283 reduced the angle in turns with Fract. For a negative argument Fract is
1 - |x|, which rounds in binary32: sin(-2**-26 turns) became +0 and the
absolute error was up to ~1.7e-7 at -0.1 turns. x - RoundEven(x) is exact in
binary32 for every finite x and keeps the angle in [-pi, pi]. The change is
inside turn_angle (shared by the f32 and f16 forms), with the variable names
of the line that test_mutations.py anchors on kept.

- tests/semantic/test_alu_sincos.py: f32/f16 against sin/cos(2*pi*x) in
  double, tiny arguments (fails on main), whole turns of either sign (+0, as
  measured on an RX 6800 by shelbykb2), +-0, inf/NaN, modifiers.
- runtime/test/shaders/cs_w32_sincos.asm: wave32 GPU regression guard
  (tolerance 1e-3, the driver Sin is only good to 2^-11), registered in
  check.py and run_gpu_tests.py.
- docs/design.md: contract row with the RX 6800 measurement and what is not
  matched (half/quarter turns, the small-x constant, inf/NaN words).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 08:34:03 -05:00
0906a75f3d docs: SHADER-135 on RDNA2 (gfx1036): f16 omod and clamp, v_fma_mix* constants, NaNs, denormals and rounding
Raw kernels through the hardware oracle on a gfx1036 iGPU (AMD Windows driver
32.0.21044.64, HIP backend), 1,385 programs in wave32 and wave64, identical
words in both:

- an omod on an f16 result (v_add/mul/fma/fmac/cvt/exp/rcp_f16) acts only with
  IEEE 0 and denorm_mode_16_64 = 0; omod comes before clamp; clamp gives +0
  for -0 and, with DX10_CLAMP 1, for a NaN;
- v_fma_mix* operands: a float inline constant is f32 or the f16 constant
  (zero high half) by op_sel_hi, an integer constant its 32-bit integer;
  denormals follow the mode of their own width; NaN payloads are kept;
- v_fma_mixlo/mixhi_f16 round once (fma_mix_probe --oracle hw, 7 of 7 ties);
- v_exp_f16 / v_log_f16 repeat gfx1031's sweep counts exactly.

The translator is compared word for word and differs in five ways, listed
in docs/shader_validation.md; none is fixed here. Docs only. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:32:59 +00:00