Skip to content

Restore the #8335 WMI guard anchor broken by the RDNA 1 wrapper - #8684

Merged
danielhanchen merged 1 commit into
mainfrom
restore-8335-wmi-guard-anchor
Aug 13, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
restore-8335-wmi-guard-anchor

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

main is currently failing tests/studio/test_amd_venv_repair_loop.ps1, and with it the #8335 regression guard.

What broke

d5a2160ef (#8577) wrapped the WMI label assignment so it no longer clobbers a ROCm-derived label:

if (-not $HasROCm) { $ROCmGpuLabel = $script:ROCmGpuLabels[0] }

That change is correct. What it also did was end the line in ] } rather than ], and the test slices the WMI fallback region out of studio/setup.ps1 with a regex terminating in \$script:ROCmGpuLabels\[0\]\n. The region stopped matching, $_wmi became the empty string, and four checks failed:

FAIL  the WMI fallback was found
FAIL  the healthy/all choice is @() wrapped
FAIL  the adapter list is @() wrapped
FAIL  the healthy list is @() wrapped

The test runs on the 3-OS matrix in cross-platform-parity-ci.yml, including the Windows PowerShell 5.1 leg, which is the only leg that can see the scalar unroll #8335 was about.

The fix

One line. The terminator now absorbs whatever guards the assignment:

\$ROCmGpuLabel = \$script:ROCmGpuLabels\[0\][^\r\n]*\n

[^\r\n]* rather than [^\n]* is load-bearing. Under [^\n]* the pattern would also match a CRLF checkout, which would silently retire the "CRLF is normalised, not tolerated" check sitting on the next line, and that check exists because a vacuously-passing region has bitten this repo before.

Verification

All 21 tests/studio/*.ps1 suites pass. Mutations on studio/setup.sh's sibling studio/setup.ps1, applied one at a time and reverted:

mutation expected result
revert to the pre-#8577 unwrapped assignment pass, the anchor must accept both forms all checks passed
reintroduce the #8335 defect ($wmiGpus = if (...), no @()) fail 2 failed
drop @() from the adapter list fail 4 failed
break the region terminator fail 4 failed

The first row is the backwards-compatibility check; the second is the one that matters, since it proves the guard is catching the original defect again rather than merely matching a non-empty region.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c5a2d714be

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 9ae9b2c into main Aug 13, 2026
28 of 38 checks passed
@danielhanchen
danielhanchen deleted the restore-8335-wmi-guard-anchor branch August 13, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant