gfx10: pin the operand widths to their opcode names #612
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!612
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:gfx10-fields-tests"
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?
Contributor role (optional)
What it changes
The problem on main: nothing. This is a tests-only change (no production line is edited).
What it pins: the operand-sizing helpers in
crates/darner-shader/src/gfx10/fields.rs—data_dwords,ds_pair,salu_dwords,valu_dwords,image_addr_dwords— decide how many dwords an instruction takes from its name, and the decoder trusts that answer for every later instruction in the stream. Their rules are non-obvious (abuffer_atomic_cmpswapcarries two dwords,s_bfm_b64is two dwords and its width comes from a suffix letter,ds_read2_b32is a pair, an image address is 4 or 2 dwords by dimension and 1 more witha16or aclsuffix), and no unit test existed for any of them.This change adds five tests, one per helper, covering the opcode families each claims to size.
How it was tested
c933664(one commit onc8258f9).cargo test --locked -p darner-shader --lib gfx10::— 21 passed (5 new plus the 16 existing in that module).cargo clippy --locked -p darner-shader --all-targets -- -D warningspasses.git stash):cmpswapsizedn *= 3→buffer_atomic_cmpswap … left: 3 right: 2"read2"→"read3"→ds_read2_b32failssalubmwidths(2,1,1)→(2,2,1)→s_bfm_b64failsvalushift widths[1,2,2]→[2,2,2]→v_lshlrev_b64fails(4,2)→(3,2),a16div_ceil(2)→/2, and dropping theclsuffix each fail their own assertion.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked: not green on this machine, and one of the reasons is worth a separate report —crates/darner-shader'soracle64::legacy_mul_forms_are_exactloopsfor bits in 0..=u32::MAXtwice over ~104 constants (about 31 billion checks) and does not finish in debug here; I let it run over 45 minutes and stopped it. That test is untouched by this change and is pre-existing. With only it skipped, the suite istest result: ok. 572 passed; 0 failed; 16 ignored; 1 filtered outin 594 s. The other pre-existing blockers are thedarner-gputest deadlock (#224) and theemit::waterfall_testsfixture failure (#227).image_sample_cd/_cd_cl/_c_cd/_c_cd_cl(0x68–0x6f) and the_g16forms are not pinned.emit/lower.rsrejects them today andfields.rstreatscdas gradients without a compare dword; if the ISA's CD form carries a compare, that is a latent one-dword undercount, but it is unexercised and could not be proven from the tree, so it is reported rather than pinned or changed.Checklist
main.docs/asset-policy.md(cargo xtask policy: 576 files ok).Checked for overlap
crates/darner-shader/src/gfx10/fields.rs(checked against the file list of all 189 open pull requests), and no open or closed issue mentions these helpers.[pr-tests][shaders] gfx10: pin the operand widths to their opcode namesto gfx10: pin the operand widths to their opcode namesView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.