From c9d2f5282878c36efcd6d3c79985286ce4a8b981 Mon Sep 17 00:00:00 2001 From: lukaslw-lab <291379150+lukaslw-lab@users.noreply.github.com> Date: Wed, 25 Nov 2026 13:35:22 +0100 Subject: [PATCH] tests: give the compute e2e root a table range for the Windows 10 runtime The Windows 10 in-box D3D12 runtime (10.0.19041) corrupts its heap in CreateRootSignature for a version 1.1 root signature whose descriptor table has no ranges. startup_compute_translate_e2e passed such a blob to the stand-in consumer, which forwards it to the desktop device, so all four e2e tests failed there with E_INVALIDARG or STATUS_HEAP_CORRUPTION. root_blob(table_range=True) adds one SRV range (t0, one descriptor) and the e2e test uses it. The default bytes are unchanged; they are part of pinned request keys. Co-Authored-By: Claude Opus 5.5 --- tests/startup_compute_translate_check.py | 2 +- tests/startup_gfx2hlsl_compute_check.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/startup_compute_translate_check.py b/tests/startup_compute_translate_check.py index 1389b32c31..dbf5d63248 100644 --- a/tests/startup_compute_translate_check.py +++ b/tests/startup_compute_translate_check.py @@ -120,7 +120,7 @@ def check_requests(directory): def check_e2e(directory, consumer, dxc, runner, adapter, wrong_group): cache, env = prepare(directory) - (directory / 'compute_root').write_bytes(C.root_blob()) + (directory / 'compute_root').write_bytes(C.root_blob(table_range=True)) # the consumer creates it on a device env['X2W_TEST_COMPUTE_ROOT'] = str(directory / 'compute_root') _, words, rsrc2, group, groups = C.CASES['A'] if wrong_group: diff --git a/tests/startup_gfx2hlsl_compute_check.py b/tests/startup_gfx2hlsl_compute_check.py index f95d196434..cb70b4c2a7 100644 --- a/tests/startup_gfx2hlsl_compute_check.py +++ b/tests/startup_gfx2hlsl_compute_check.py @@ -310,13 +310,19 @@ def splice(*lines, at=STORE_A): *CASES['A'][2:]) -def root_blob(constants=2): - """RTS0: param 0 = root constants (b0), param 1 = a descriptor table with no ranges.""" +def root_blob(constants=2, table_range=False): + """RTS0: param 0 = root constants (b0), param 1 = a descriptor table with no ranges. + + table_range gives the table one SRV range (t0, one descriptor) for a blob that a device creates: the Windows 10 + in-box D3D12 runtime (10.0.19041) corrupts its heap in CreateRootSignature for a table with no ranges. The + default bytes are unchanged because they are part of pinned request keys. + """ params_at, constants_at = 24, 24 + 2 * 12 table_at = constants_at + 12 - rts0 = (struct.pack('<6I', 2, 2, params_at, 0, table_at + 8, 0) + ranges = struct.pack('<6I', 0, 1, 0, 0, 0, 0xffffffff) if table_range else b'' # SRV, 1, t0, space 0, append + rts0 = (struct.pack('<6I', 2, 2, params_at, 0, table_at + 8 + len(ranges), 0) + struct.pack('<3I', 1, 0, constants_at) + struct.pack('<3I', 0, 0, table_at) - + struct.pack('<3I', 0, 0, constants) + struct.pack('<2I', 0, table_at + 8)) + + struct.pack('<3I', 0, 0, constants) + struct.pack('<2I', len(ranges) // 24, table_at + 8) + ranges) part = b'RTS0' + struct.pack('