Repository navigation
Conversation
The 195 "an address in an SGPR that is no root parameter" failures are the GS half of one merged ES+GS stage (fxceless#138). Step 1 of its support, without emitting anything: - StageIo::Gs and io::raise for a geometry program. User data 0 and 1 of the merged stage (s8, s9) are the console runtime's table pointer when the root layout puts nothing there; resource tracking traces a load through it to resource::RUNTIME_TABLE instead of failing. Other stages and other unbound SGPRs fail as before. - merged::pair_es_gs pairs the ES program (vertex container) with the GS program (geometry container): same wave size, one meaning per user-data dword, merged root layout. emit::translate_merged_gs runs the pair as far as emission. - emit refuses a geometry program with GS_EMIT ("GS emit"). `translate` counts those on their own "geometry" line, not among the failures. Not done: DXIL geometry emission, the ES to GS handoff through LDS, the output records, GS_EMIT/GS_CUT, the host pipeline. The runtime table's contents and the GS stage data are not read. Refs fxceless#138 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fxceless#138) pair_es_gs keeps both halves' ranges of one descriptor table pointer instead of calling them a user-data conflict. The runtime table pointer is only inferred through resource::track_merged, i.e. for the merged layout of a pair (translate_merged_gs) or, in victory translate, as a stated assumption for an unpaired geometry program: a geometry program traced alone no longer takes user data 0 and 1 as free. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s#311) StageIo::Es and StageIo::Gs now carry MergedIo (LDS bytes from the common record). merged::limits counts the vertices a GS program emits along its longest path from its s_sendmsg GS_EMIT / GS_CUT / GS_EMIT_CUT messages, refusing a message in a loop. The runtime table pointer is also resolved for the ES half, which shares the SGPRs. victory translate counts the GS programs with a bounded vertex count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
) handoff finds the record the ES half writes to LDS (whole-dword writes at one base, then s_barrier and the s_setpc_b64 handover) and the GS half's reads of its input vertices (the halves of the offsets in v0 and v1). The GS half may only read dwords the ES half writes. emit::merged_halves pairs two containers, traces and raises the ES half and checks the handoff; victory translate counts the ES programs on their own line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xceless#313) The ES half becomes a DXIL vertex shader: each record dword written to LDS is a channel of a synthetic TEXCOORD register (32-bit integers), s_barrier a nop and the s_setpc_b64 handover an end. The GS half becomes a geometry shader (triangles in, triangle strip out, stream 0): reads of an input vertex record are loadInput, its own LDS writes go to a private array, the k-th GS_EMIT copies record k to the output signature and emits, GS_CUT cuts the strip, the runtime table load reads zero. translate_merged_gs now returns both shaders. Tests use synthetic GCN programs only; the DXIL validator accepts both modules. Assumed, not verified on a title program: record dword 4*row+col is that channel of the output register, emits are numbered in code order, triangle strip topology, one instance, ES vertex id in v0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…unts (fxceless#311) Review fixes: a GS program with an indirect jump has no vertex bound, and the user-data overlap tests saturate the container-supplied SGPR count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… bits (fxceless#312) Review fixes: an ES half must hand over on every reachable path (a reachable s_endpgm loses the record), the barrier flag holds only when a barrier precedes every handover, v_bfe_u32 offsets are read in five bits, and victory translate reports an ES half whose record analysis fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xceless#314) A title pipeline with a vertex and a geometry container is a merged ES+GS stage: the two containers are translated together (translate_merged_gs, kept by the pair of hashes) and the host pipeline gets a vertex shader, a geometry shader (root parameters with geometry visibility) and the pixel stage. Triangle topologies only; the library name of such a pipeline is its own. victory-shader gets a synthetic feature with the synthetic containers its tests use, for the victory-gpu test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ccfea0e84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| let (name, value) = if e.comp == 9 { | ||
| ("storeOutput.f32", self.as_float(bits)) |
There was a problem hiding this comment.
Convert half-precision geometry outputs
When the geometry output signature marks an element as 16-bit (e.half), this path still reads a full record dword and forwards its raw bits through a 32-bit output operation. Unlike the regular export path, it never unpacks or widens the half value, so GS varyings or positions from such signatures are corrupted; reject these outputs or convert them before storing.
Useful? React with 👍 / 👎.
| .op(self.cur, "barrier", Attr::NoDuplicate, void, 80, &[mode]); | ||
| Ok(()) | ||
| } | ||
| Fields::Sopp { .. } if name == "s_sendmsg" && self.x.gs.is_some() => { |
There was a problem hiding this comment.
Handle halting geometry messages
When a GS uses s_sendmsghalt for GS_EMIT or GS_CUT, planning recognizes the message and assigns it an output record, but this dispatch handles only s_sendmsg. The halting instruction falls through as a no-op, so the translated shader omits the emission or cut while still declaring the vertex maximum; handle both opcodes or refuse the halting form.
Useful? React with 👍 / 👎.
| unreachable!() | ||
| }; | ||
| let name = inst.name(); | ||
| if self.scalar.get(&site).is_some_and(|a| a.param == RUNTIME_TABLE) { |
There was a problem hiding this comment.
Preserve non-base runtime-table loads
Whenever a GS reads the runtime table, this branch replaces every scalar destination with zero without checking the load offset or proving that the value is used only as the relocatable LDS base. If a table field also feeds an output value, condition, or other computation, the pair is still accepted but silently produces results based on zero; limit this substitution to proven base-only uses or refuse other accesses.
Useful? React with 👍 / 👎.
| (None, None) => return refuse("no vertex or mesh shader", shaders), | ||
| }; | ||
| let mut stages = vec![first]; | ||
| stages.extend(merged.as_ref().map(|m| (&m.1, D3D12_SHADER_VISIBILITY_GEOMETRY))); |
There was a problem hiding this comment.
Share the merged-stage user-data block
The ES and GS halves share one user-data layout, but adding the translated GS here sends it through the per-stage root-parameter construction, which allocates a second root-constants block for the same registers. If those duplicated constants plus the other parameters exceed D3D12's 64-DWORD root-signature limit, serialization fails and HostPipeline::new drops every draw for that pair; share the merged block or otherwise keep it within the limit.
Useful? React with 👍 / 👎.
|
In-game run of the stacked head (release build, one session of about 9 minutes, the usual script to the lit cell scene): 0 The 195 failing programs: |
…xceless#313) Review fixes: s_sendmsghalt emits/cuts and half-precision outputs are refused, the emitted output signature marks the components the emits store, an input vertex offset must be scaled to bytes, a second runtime table field is refused (the one read is taken as the output base), and the returned vertex shader says it is a vertex shader. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # crates/victory-shader/src/emit/gs.rs
|
Review findings: the three on the geometry emission (
Workspace tests on the head ( |
Step 5 of #138, for #314. Stacked on #381 (#313), itself on #373 (#312), #367 (#311) and #309: the diff here includes theirs until they merge; the commit of this step is the last one. Base is
mainbecause the stacked branches are not in this repository.What is in it
pipeline::merged_pairtranslates the two containers together (emit::translate_merged_gs) into a vertex and a geometry shader, each aShaderwith its translation made; the pair is kept by the two containers' hashes, so two pipelines sharing a GS container with different ES containers are two pairs (in memory only, translated again at each start).HostPipeline::newtakesgeometrystages: vertex, geometry (root parameters with geometry visibility, same user-data / root-view handling as the other stages) and pixel; the GS bytecode goes in the PSO. Stages are found by visibility rather than by position. The library name of such a pipeline is its own (graphics geometry).syntheticfeature with the synthetic containers its tests use, for the victory-gpu test.Tested
HostPipeline::newon a synthetic ES+GS pair and a pixel container gives a three-stage host pipeline (vertex, geometry, pixel), the pair's translation is shared, a non-triangle topology and a missing vertex container are refused. Runs on the host GPU (skipped without one).cargo build --workspace --locked,cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 536 passed, 0 failed, 7 ignored (Windows).Not tested / assumed
victory translatestill counts geometry programs on their own line: the ES half a GS pairs with lives in another container, only known from a title pipeline at run time, so the batch tool cannot measure the pair path.non verifiein this PR (see the comment below if a run was made).AI use
Written with Claude Code (Claude Sonnet 5.5). The tests are synthetic programs; no title shaders or game files were read.
🤖 Generated with Claude Code