PS-INPUT-SIGNATURE: select pixel shaders by source container signature #514

Closed
bobcatchris wants to merge 2 commits from upstream-pr/514 into main
bobcatchris commented 2026-11-24 06:42:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T06:42:07Z.


Claimed in the coordination issue as: PS-INPUT-SIGNATURE

Depends on: #505

What and why

Two containers can hold the same pixel program while declaring SV_Position differently: one uses depth, the other reciprocal W. The first entry in the shader index can then bind a translation whose position convention does not match the source container, turning a red draw black or the reverse.

This selects pixel shader translations by the source container's input signature. It follows #505, which introduces the shared signature-aware candidate selection used here.

Carried from the source patch:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@33ab48d3ea/README.md (pixel-shaders-with-the-same-program-and-different-position-inputs)

No game data, keys, or decryption are included.

Tested

  • Built and ran shader_library_test with the full two-commit stack: OK
  • python -I tests/test_shader_meta.py — OK
  • python -I tests/test_docs_links.py — OK
  • python -I tests/test_docs_cli_flags.py — OK
  • python -I tests/test_ci_registration.py — OK
  • python -m compileall -q tools tests — OK
  • pixel-only diff and full stack git diff --check clean
  • security sweeps: 0 hits

The source report measured the two cases on an RTX 4070 Ti: 4096 black pixels with the original lookup and 4096 red pixels after the fix for the reciprocal-W case, and the reverse for the depth case. I did not repeat that GPU measurement locally.

GPUs tested: n/a locally; source report used NVIDIA GeForce RTX 4070 Ti

AI-assisted: yes

Checklist

  • Based on current main plus the stated dependency and merges cleanly.
  • One topic; the dependency commit is #505.
  • No game data, keys or decryption.
  • Regression tests added for source-container pixel selection and shader metadata.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467430188 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T06:42:07Z. --- Claimed in the coordination issue as: PS-INPUT-SIGNATURE Depends on: #505 ### What and why Two containers can hold the same pixel program while declaring `SV_Position` differently: one uses depth, the other reciprocal W. The first entry in the shader index can then bind a translation whose position convention does not match the source container, turning a red draw black or the reverse. This selects pixel shader translations by the source container's input signature. It follows #505, which introduces the shared signature-aware candidate selection used here. Carried from the source patch: https://github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches/blob/33ab48d3ea90f9925351aeee8708181a71fb9634/README.md#pixel-shaders-with-the-same-program-and-different-position-inputs No game data, keys, or decryption are included. ### Tested - Built and ran `shader_library_test` with the full two-commit stack: OK - `python -I tests/test_shader_meta.py` — OK - `python -I tests/test_docs_links.py` — OK - `python -I tests/test_docs_cli_flags.py` — OK - `python -I tests/test_ci_registration.py` — OK - `python -m compileall -q tools tests` — OK - pixel-only diff and full stack `git diff --check` clean - security sweeps: 0 hits The source report measured the two cases on an RTX 4070 Ti: 4096 black pixels with the original lookup and 4096 red pixels after the fix for the reciprocal-W case, and the reverse for the depth case. I did not repeat that GPU measurement locally. GPUs tested: n/a locally; source report used NVIDIA GeForce RTX 4070 Ti AI-assisted: yes ### Checklist - [x] Based on current `main` plus the stated dependency and merges cleanly. - [x] One topic; the dependency commit is #505. - [x] No game data, keys or decryption. - [x] Regression tests added for source-container pixel selection and shader metadata.
PierreEbele commented 2026-11-24 21:26:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T21:26:18Z.


Reviewed 629abfd9: ran tests/test_shader_meta.py on the PR and main (29/28 pass; the new test fails on main with {} != {'input_signature': []}), built and ran runtime/test/shader_library_test on both trees (passes; the copied test does not compile on main as it uses the new candidates() overload), and fuzzed read_dxbc_meta with 4,008 synthetic ISG1 chunks: no exceptions, the only behavior change is the documented empty-signature recording, and a port of matches_isg1 round-trips every recorded signature except non-ASCII semantic names or component types outside 1..3, which fall back to the full candidate list as before. No findings; the Windows-only device change is a mechanical span refactor (desk-checked). AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144929566 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/514#issuecomment-7144929566). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-24T21:26:18Z. --- Reviewed 629abfd9: ran tests/test_shader_meta.py on the PR and main (29/28 pass; the new test fails on main with {} != {'input_signature': []}), built and ran runtime/test/shader_library_test on both trees (passes; the copied test does not compile on main as it uses the new candidates() overload), and fuzzed read_dxbc_meta with 4,008 synthetic ISG1 chunks: no exceptions, the only behavior change is the documented empty-signature recording, and a port of matches_isg1 round-trips every recorded signature except non-ASCII semantic names or component types outside 1..3, which fall back to the full candidate list as before. No findings; the Windows-only device change is a mechanical span refactor (desk-checked). AI-assisted review. **Recommendation:** Merge
bobcatchris commented 2026-11-24 23:42:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T23:42:49Z.


Rebased onto the updated #505 branch, preserving the dependency without duplicating the VS commit. Verified: shader_library_test passes, test_shader_meta.py 29/29, no-game-data and security checks clean.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147711275 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/514#issuecomment-7147711275). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T23:42:49Z. --- Rebased onto the updated #505 branch, preserving the dependency without duplicating the VS commit. Verified: shader_library_test passes, test_shader_meta.py 29/29, no-game-data and security checks clean.
MoonEyes commented 2026-11-28 17:58:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:58:20Z.


Hi @bobcatchris, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/d3d12_vulkan_device.cpp, runtime/src/shader_library.h), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243428873 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514#issuecomment-7243428873). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T17:58:20Z. --- Hi @bobcatchris, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/d3d12_vulkan_device.cpp`, `runtime/src/shader_library.h`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
bobcatchris commented 2026-11-29 13:11:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T13:11:10Z.


Rebased cleanly onto rebased #505 / main (cc0f662a7, head 60ec02195). Re-verified shader_library_test (PASS) and python -I tests/test_shader_meta.py (31/31 OK) on Windows 11. AI-assisted: Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256351147 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514#issuecomment-7256351147). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-29T13:11:10Z. --- Rebased cleanly onto rebased #505 / main (cc0f662a7, head 60ec02195). Re-verified shader_library_test (PASS) and python -I tests/test_shader_meta.py (31/31 OK) on Windows 11. AI-assisted: Antigravity (Gemini 4 Neon).
bobcatchris commented 2026-11-29 16:28:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T16:28:55Z.


Rebased onto updated #505 (17bde25e, head $h514) and added the measured 1.0.2.1 shaders.rpf PS corpus counts to docs/d3d12_vulkan.md (12,101 pixel shaders, 59 shared-FSSM groups across 123 containers, 1 group / 2 shaders diverging on ISG1
w_mask, 13 empty 0-row ISG1). Re-verified python -I tests/test_shader_meta.py (31/31 OK) and check_no_game_data.py clean. AI-assisted: Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258937112 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514#issuecomment-7258937112). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-29T16:28:55Z. --- Rebased onto updated #505 (17bde25e, head $h514) and added the measured 1.0.2.1 shaders.rpf PS corpus counts to docs/d3d12_vulkan.md (12,101 pixel shaders, 59 shared-FSSM groups across 123 containers, 1 group / 2 shaders diverging on ISG1 w_mask, 13 empty 0-row ISG1). Re-verified python -I tests/test_shader_meta.py (31/31 OK) and check_no_game_data.py clean. AI-assisted: Antigravity (Gemini 4 Neon).
bobcatchris commented 2026-11-29 18:45:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T18:45:32Z.


Temporarily closing while stacked dependency #505 is in review so we can submit independent, zero-conflict fixes; branch pixel-input-signature remains intact and will be reopened once #505 lands.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260734918 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514#issuecomment-7260734918). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-29T18:45:32Z. --- Temporarily closing while stacked dependency #505 is in review so we can submit independent, zero-conflict fixes; branch pixel-input-signature remains intact and will be reopened once #505 lands.
bobcatchris commented 2026-11-29 18:45:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T18:45:44Z.


Reopening — PR creation is still capped with #489 and #505 open (1-open-PR limit), so keeping #514 open and ready.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260737666 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/514#issuecomment-7260737666). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-29T18:45:44Z. --- Reopening — PR creation is still capped with #489 and #505 open (1-open-PR limit), so keeping #514 open and ready.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!514
No description provided.