Skip to content

D3D12: ports keyed by (name, code object), so one kernel name can have ports of several builds - #143

Merged
phantoslayer21 merged 5 commits into
mainfrom
dx12/manifest-by-co
Nov 14, 2026
Merged

phantoslayer21 merged 5 commits into
mainfrom
dx12/manifest-by-co

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

Refs #89

The D3D12 devices now key their ports by (name, code object), so one kernel name can have ports of several builds of its HIP kernel.

Why: Model L's model file has no output-filter weights, so the runtime loads post_w64.co (analytic filter) under w64. D3D12 has only the original-filter build's ports (post_w64__orig.co), and the manifest keyed ports by name alone, so the analytic ports of the same names could not sit next to them. The analytic ports follow in their own PR.

What

  • clean/runtime/device_d3d12.cpp (native, backend 3) and clean/runtime/device_dx12.cpp (hybrid, backend 2):
    • ports in a multimap by name; a launch runs the port whose co the runtime loaded (the existing rule);
    • with no selected port, the first one, so the error or note is the same as before;
    • the native device refuses two entries with the same name and co.
  • clean/dx12/build_dx12.py:
    • entries keyed by (name, co); manifest order by name, then co;
    • a second port of a name sets file=<stem> for its DXIL file name (a clash is refused).
  • clean/dx12/README.md: the rule.
  • Launch sites and kernel names are unchanged.

Tested

  • Both device sources compile (clang++ -fsyntax-only, HIP SDK host compiler).
  • build_dx12.py --only exposure_auto_diet,native_fill,l_coef from main and from this branch: the manifests are identical, and so are their DXILs (the SHA-256 values are in the manifests). Existing manifests and DXILs do not change, because each name has one entry today.
  • Public gates; leak scan 0 hits.

Not tested

  • A manifest with two ports of one name: that needs the analytic ports (next PR), whose GPU record will show the selection.
  • A GPU run of the devices with this change (no D3D12 launch path changed for a name with one port).

…e ports of several builds

The native and hybrid devices keep their ports in a multimap by name and run the one whose code
object the runtime loaded (the existing co rule); the manifest may hold one entry per (name, co).
build_dx12.py keys its entries the same way; a second port of a name sets file=<stem> for its DXIL.
Needed for the analytic-filter ports of post_w64.co next to the original's (post_w64__orig.co).
Existing manifests and DXILs are unchanged.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 04:16
@phantoslayer21
phantoslayer21 merged commit fccbb2d into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the dx12/manifest-by-co branch November 14, 2026 04:22
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant