Repository navigation
scripts: the short form v_add_co_ci_u32 vD, src0, src1 reads src0 (SCRIPTS-SHORT-CO-CI-OPERANDS) - #2494
Open
kawaii-shakal wants to merge 1 commit into
Open
scripts: the short form v_add_co_ci_u32 vD, src0, src1 reads src0 (SCRIPTS-SHORT-CO-CI-OPERANDS)#2494kawaii-shakal wants to merge 1 commit into
kawaii-shakal wants to merge 1 commit into
Conversation
…RIPTS-SHORT-CO-CI-OPERANDS) audit_shader4_regs.rbw_registers and vs_input_survey.read_before_write took every VOP `_co_` op with a scalar second operand as vdst + carry-out. The assembler's short form v_add_co_ci_u32 vD, src0, src1 (also sub and subrev) has VCC as its carry-out and carry-in and names neither, so its second operand is src0, a read: an SGPR there was counted as written and dropped from the read-before-write sets. For audit_shader4_regs that hid exactly the s3 read the audit looks for. The same fix ubiquitarianism#2357 makes in lane_masks, wave64_halves and writes_exec (wavehs's follow-up there). Tests: test_short_form_carry_in_reads_s3_in_the_audit and test_short_form_carry_in_reads_its_scalar_src0 fail on main (s3 missing from the read-before-write sets) and pass here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item: SCRIPTS-SHORT-CO-CI-OPERANDS (claimed in #1608).
audit_shader4_regs.rbw_registersandvs_input_survey.read_before_writetook every VOP_co_op with a scalar second operand as vdst + carry-out. The assembler's short formv_add_co_ci_u32 vD, src0, src1(alsosub,subrev) has VCC as its carry-out and carry-in and names neither, so its second operand is src0, a read. On main,v_add_co_ci_u32_e32 v1, s3, v2thens_mov_b32 s9, s3reports no SGPR read before a write in either script; foraudit_shader4_regsthat hides thes3read the audit exists to find. This is the follow-up wavehs suggested in #2357, which fixes the same form inlane_masks,wave64_halvesandwrites_exec; it does not depend on #2357.Tests (Linux, Python 3.13, CPU only, no GPU or game files):
tests/test_audit_shader4_regs.py::test_short_form_carry_in_reads_s3_in_the_auditandtests/test_vs_input_survey_rbw.py::test_short_form_carry_in_reads_its_scalar_src0(3 ops): fail on main 43a9d56 ({} != {'s3': 3};s3missing fromread_s), pass here.tests/test_audit_shader4_regs.py21/21,tests/test_vs_input_survey_rbw.py13/13,tests/test_vs_input_survey.pyandtests/test_tool_stdout_encoding.pypass;check_no_game_data.pyon the four files,compileall,test_text_write_line_endings.pyandgit diff --checkare clean.AI-assisted (Claude Code): the change and the tests were written with it; I reviewed them and ran the tests.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3