shader: inventory candidate programs for a named SGD5 effect #310
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/315"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T21:49:42Z.
Change
Fixes #307. Given an independently located SGD5 group, its program-array offset, and one named effect record, report each referenced program in stored order. The JSON includes the stored group, group-local index, program name, DXIL shader kind and decoded-container SHA-256. Repeated names can identify different containers. The stored VS group can include a mesh shader.
Verification
Tested on Windows with Python 3.12.10 at
a08f34d9b8d3aa15642d151c038156f6f3bfd9e1.python -B tests/sgd5_effects_check.py -vpassed both test methods. The CLI test initially failed because the command was missing. A subsequent regression claimed a second effect while the selected record occupied the entire remaining group. It was accepted before the count check accounted for the selected span and rejected afterward.cmake --fresh --preset dev -DINTAKE_PYTHON=<worktree-python>andctest --preset dev --no-tests=error -R "^(sgd5_effect_candidates|docs_links)$" -Vpassed. The documentation check covered 67 links in 10 files.python -B tools/sgd5_effects.py archive.bin EFFECT --group GROUP_START GROUP_END --arrays ARRAY_OFFSET --record EFFECT_START EFFECT_ENDon two independently located local effects reported 5 and 81 candidates, including 2 and 41 pixel candidates respectively. All pixel ordinals and container digests agreed with a separate decode.Evidence and follow-up
The tests generate their SGD5 records, raw-DEFLATE wrappers and minimal DXBC/DXIL headers from repository-licensed Python source. Controls cover duplicate names across and within groups, reversed candidate order, neighboring records, an out-of-group index, truncated framing and a byte budget verified before payload access. An instrumented reader limits individual reads to seven bytes and rejects reads from an unselected compressed payload.
Effect bounds and the table offset come from the caller. The parser treats the intervening technique/state bytes as opaque. Determining which candidate a draw selects still requires pass-selection evidence. README entry · CLI and sample measurements · Public SGD5 program table · Related SGD2 effect layout
Checklist
AI-assisted contribution.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T21:54:53Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
a08f34d9b8ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T21:56:57Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T21:49:52Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
a08f34dℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T22:00:22Z.
@codex review
Please recheck
dc21141ee0, including the padded DXIL part and its two adjacent size controls. All three CI jobs passed.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T21:54:53Z.
Code review location:
tools/sgd5_effects.py; line 102For a DXIL part containing trailing padding or extension data after the program's declared
SizeInUint32extent, this equality check rejects the candidate and aborts the entire effect inventory. The existingresource_inventory.dxil_programanddxil_retarget.unpack_dxil_programvalidators allow4 * words <= len(program). Appending four bytes to the synthetic DXIL part while updating its part/container extents is accepted by both shared validators but rejected here. Validate that the declared program fits inside the part rather than requiring it to occupy the whole part.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T21:56:57Z.
Code review location:
tools/sgd5_effects.py; line 102Reproduced on
a08f34dwith an eight-word program inside a nine-word DXIL part. Both resource_inventory.dxil_program and dxil_retarget.unpack_dxil_program accepted it while the effect inventory rejected it. Commitdc21141checks the payload end against the declared program end and the program end against the part end. The padded case now retains its full-container digest. Declaring seven words truncates the payload and ten words overruns the part; both are rejected. The two local effect runs still report 5 and 81 candidates, including 2 and 41 pixel programs with independently matching digests. Their framed payloads use a different signature from desktop LLVM bitcode, so the inventory validates their extents without requiring that signature. Direct Python (three tests) and the focused CTest run passed.