Repository navigation
fix(recompiler): leave out descriptor sources behind a branch the capture decides - #3952
Conversation
|
The new comments in |
|
Pushed the change you asked for: the Tested: AI-assisted (Claude Code). |
0055753 to
d7313bb
Compare
|
Rebased onto AI-assisted (Claude Code). |
…ture decides A compute kernel that picks a buffer or an image path from an SRT word reads the same address as a V# in one path and as a T# in another. The resource tracker now records which block uses each descriptor source and builds the resource control flow from the structured block terminators, so a source whose only uses sit behind a conditional branch with a clean, evaluable condition is left inactive (bound as zero words, not validated) when the capture takes the other path. A condition that reads inaccessible memory is not evaluable instead of throwing. PPSA15246 (Teardown) stopped on "runtime image descriptor is invalid" for the untaken path of such a kernel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lanner Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…scriptor source Several image instructions of different dimensions on the same T# address share one descriptor source, so a source stays active as soon as one of them is taken and the others are still checked against the T#. Record the images a block uses as well, deactivate the images used only behind a branch the capture does not take, and bind them as null descriptors. PPSA15246 (Teardown) then passes the "incompatible with the static runtime image interface" check of the three image_store variants that are not taken. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… roots A branch condition that reads through a null user-data pointer is now treated as not evaluable instead of being caught, so every successor stays active. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
d7313bb to
8f254e0
Compare
What
A compute kernel can pick a buffer or an image path from a word of its SRT and read the same address as a V# in one path and as a T# in the other. Teardown (PPSA15246) has such a copy kernel; the recompiler validated the descriptor of the path the capture does not take and threw
runtime image descriptor is invalid(details in #3701).The machinery to leave such a source out already exists (
IrResourcePlan::controlFlowand theactivepass inEvaluateRuntimeSourcesImpl: an inactive source is bound as zero words and not validated), but nothing outside a unit test filledcontrolFlow. This PR fills it:ResourceTrackerrecords, per block, the descriptor sources the block uses, and buildscontrolFlowfrom the structured block terminators (blockInfo: true/false blocks and the branch condition). A block whose terminator is neither a plain nor a conditional branch (indirect branches, loop headers) keeps all its CFG successors, so no source is dropped for a path that cannot be decided.controlFlowis only set when some source is used only behind a conditional branch; otherwise the plan is unchanged.verifyGuardedDescriptorSourcesinShaderMemory.cpp: a T# behind a branch on an SRT word is left null when the branch skips it (even if it holds garbage), still read when the branch is taken, and still rejected when invalid and taken; and twoimage_stores of different dimensions on one T# in the two branches compile for the dimension that matches and fail for the one that does not. It fails without the change (the branch around the image was not planned, and without the image trackingincompatible with the static runtime image interface).docs/dev/TechnicalDebt.mdlists the limits.Tested
main(a11c8f7f7):agc_shader_memorypasses with the new case and fails without the change. 37 related tests pass (agc_shader_*,agc_structurizer,agc_scalar_select_mask,agc_driver_{bindless_images,compute_user_data_calls,guarded_null_pointer,oversized_descriptor_sets,scalar_*},shader_buffer_address);agc_driver_oversized_dispatchwas not built here, so not run.tools/check_conventions.py --base upstream/mainpasses.runtime image descriptor is invalidstop and the followingimage descriptor is incompatible with the static runtime image interfacestop are both gone; the copy kernel now compiles and the title runs on tosceNpTrophy2GetGroupInfo: invalid argumentandAGC graphics: CMASK fast clears of a mipmapped, 3D or array color target are unsupported. Both are unrelated to this change.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)