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>
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: e62e1c740d
ℹ️ 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".
| /// (`s_setpc_b64`), touches LDS in any way but whole-dword record writes, | ||
| /// writes at more than one base, or writes nothing. | ||
| pub fn es_record(p: &Program) -> Result<EsRecord, ShaderError> { | ||
| if !p.blocks.iter().any(|b| b.exit == Exit::Indirect) { |
There was a problem hiding this comment.
Require every reachable ES exit to hand off
If an ES CFG has one reachable s_setpc_b64 exit and another reachable s_endpgm exit, this check succeeds, so es_record and handoff accept a pair even though that branch never transfers the record to GS. Validate that every reachable terminal path hands off, rather than only requiring one indirect exit.
Useful? React with 👍 / 👎.
| ("v_bfe_u32", [x, off, width]) if c(width) == Some(16) && c(off).is_some_and(|o| o % 16 == 0) => { | ||
| match x.base { | ||
| Base::Input(reg) if plain(x) => Lin::of(Base::Half { reg, high: c(off) == Some(16) }), |
There was a problem hiding this comment.
Normalize BFE offsets before classifying halves
For a v_bfe_u32 with inline offset 48, this condition accepts the offset, but the branch below labels only exactly 16 as the high half. GFX10 masks BFE offsets to five bits (as emit/lower.rs::bfe does with off & 31), so 48 selects bit 16; vertex_reads then attributes a vertex-1 read to vertex 0, which can make the handoff check validate the wrong record. Classify the masked offset or reject values other than 0 and 16.
Useful? React with 👍 / 👎.
| let mut barrier = false; | ||
| for (b, block) in p.blocks.iter().enumerate() { | ||
| for (i, inst) in block.insts.iter().enumerate() { | ||
| barrier |= inst.name() == "s_barrier"; |
There was a problem hiding this comment.
Track barriers along the handoff path
If an ES CFG has s_barrier only in an unreachable block or on a branch that does not reach s_setpc_b64, this assignment still marks EsRecord.barrier true. The returned record then incorrectly says the handoff path is preceded by a barrier; derive the flag from barriers that precede each reachable handoff instead of any barrier in the program.
Useful? React with 👍 / 👎.
| let es = p.stage == HwStage::Es; | ||
| t.gs_programs += usize::from(geometry); | ||
| t.es_programs += usize::from(es); | ||
| if es && let Ok(r) = victory_shader::handoff::es_record(&program) { |
There was a problem hiding this comment.
Report failed ES record analysis
When es_record rejects an ES program, this if let Ok discards the error. If resource, I/O, and structure checks pass, the later ES-only continue skips emission too, so victory translate leaves the invalid ES half out of t.failed and --list; record the error in the tally.
Useful? React with 👍 / 👎.
…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>
|
All four findings fixed in 9acd8f0 (with tests), on top of the #311 fixes (d8e53e1):
Workspace build and |
Step 3 of #138, for #312. Stacked on #311 (#367), itself on #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
handoff::es_record: from the ES program, the record it writes to LDS (ds_write_b32..b128at one base address with constant offsets: dwords, VGPRs, highest dword), whether ans_barrierprecedes the handover, and a refusal of an ES half that does not leave throughs_setpc_b64, reads or does atomics on LDS, writes at two bases, off a dword, or writes nothing.handoff::vertex_reads: from the GS program, its reads of input vertices: an address that is the low or high half of v0 or v1 (v_and_b32 0xffff,v_lshrrev_b32 16,v_bfe_u32, scaled and offset) is vertex 0, 1 or 2's record. A fourth vertex is refused; reads at other addresses are the GS half's own output memory and left to the output step.handoff::handoffchecks the GS half reads only dwords the ES half writes.emit::merged_halvesis the pairing entry point: pair, ES half traced / raised / structured with the merged layout, then the handoff;translate_merged_gsgoes through it before stopping atGS emit.victory translate: ES programs get their ownesline (traced, raised, writing a record, largest record) and no longer fall out of the batch silently.What the LDS in a graphics stage comes to (reading
emit/lower.rs, not tested): LDS exists in the lowering only where a stage declares groupshared memory (compute, mesh). The handoff does not need it: the ES records become vertex outputs, the GS reads become input loads, and the barrier is the stage boundary. That is the model the next step emits.Tested
merged_halvesandtranslate_merged_gs.cargo build --workspace --locked,cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 523 passed, 0 failed, 7 ignored (Windows).Not tested / assumed
victory translateover the title, which I did not.AI use
Written with Claude Code (Claude Sonnet 5.5). The tests are synthetic programs; no title shaders or game files were read.