Skip to content

Make the WSL compiler-intermediate control say why it failed - #11312

Merged
danielhanchen merged 1 commit into
mainfrom
fix/wsl-compiler-control-diagnosable
Sep 19, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/wsl-compiler-control-diagnosable

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The failure

The wsl ubuntu-24.04 leg of Clean machine install has failed every completed run since #10978 added its positive control:

##[error]the compiler-intermediate detector is broken: it found 0 of 2 planted files under C:\Users\RUNNER~1\AppData\Local\Temp
##[error]Not reporting this run as clean. A search that cannot see a file it just wrote cannot see one csc.exe wrote either.

Last green 164d154dd, first red 040403021, and #10978 is the only change to this workflow across that boundary. So the control has never once fired: the lane has been red for three days and the security property it guards -- that the WSL installer does not run the C# compiler on the user's Windows machine -- has not actually been checked in that time.

It went unnoticed because the job is if: github.event_name != 'pull_request'. #10978's own PR could not run it, and neither can this one.

Cause

The control planted two files and then matched the sweep results with:

Where-Object { $_.FullName -like (Join-Path $controlDir '*') }

That compares two strings that need not spell the same directory the same way. %TEMP% on a hosted runner is the 8.3 form (C:\Users\RUNNER~1\AppData\Local\Temp), and whether an enumerated FullName comes back short or long is not something a detector should be betting on.

The planted files now carry a nonce in their name and are matched by name, so nothing has to agree about paths.

Evidence

I could not reproduce this from Linux, and said so rather than guessing: -LiteralPath -Recurse -Include resolves correctly here (2/2), and a symlink simulation of a divergent path spelling also passed, which argued against the short-name theory rather than for it.

Since no PR can run this lane, I dispatched the workflow on this branch. On the same windows-latest runner that had been failing:

positive control fired: the detector saw both planted intermediates under C:\Users\RUNNER~1\AppData\Local\Temp
no compiler intermediates left behind, and no generated script left behind

Run 35401099963, wsl ubuntu-24.04: success, the first since 15 September. Only the match method changed, so that is the mechanism. The precise reason FullName and $controlDir disagreed on Windows is inferred from the 8.3 root; what is measured is that removing the path comparison fixes it.

Robustification

The step exists because a detector that sees nothing looks exactly like a clean run and every reason it could see nothing is silent. The control reproduced that same flaw one level up: writing the files, sweeping %TEMP% and matching the results all failed as an identical 0 of 2, which is why this sat unexplained for three days.

It now reports all three: how many control files reached disk, how many intermediates the sweep returned in total, and where it planted them. The next failure names its own cause instead of needing a dispatch to investigate.

Verified in pwsh before dispatch: onDisk=2 sweep=3 seen=2, where the sweep also picks up an unrelated .rsp, so the match is not merely seeing its own files.

The wsl leg of Clean machine install has failed every completed run since #10978
added the positive control, on:

    the compiler-intermediate detector is broken: it found 0 of 2 planted files

so the control has never once fired. The check exists because a detector that sees
nothing looks exactly like a clean run and every reason is silent -- and it
reproduced that same problem one level up: writing the files, sweeping %TEMP% and
matching the results all fail as an identical '0 of 2'.

Report all three: how many control files reached disk, how many intermediates the
sweep returned in total, and where it planted them. The next run names its own cause.

Also drop the directory-prefix comparison. The planted files now carry a nonce in
their name and are matched by name, so nothing has to agree on how a directory is
spelled -- %TEMP% on a hosted runner is the 8.3 form (C:\Users\RUNNER~1\...) and
whether an enumerated FullName comes back short or long is not something this check
should bet on. That removes one of the three candidate failure modes; it is not
established as the guilty one.

Verified in pwsh: onDisk=2 sweep=3 seen=2, where the sweep also picks up an
unrelated .rsp, so the match is not just seeing its own files.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T23:09:10.179064Z 8168f93 Manual request
🔒 Security Review ✅ Completed 2026-09-18T23:11:14.490581Z 8168f93 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 8168f93508

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8168f93508

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@danielhanchen
danielhanchen merged commit 1be9dc0 into main Sep 19, 2026
40 checks passed
@danielhanchen
danielhanchen deleted the fix/wsl-compiler-control-diagnosable branch September 19, 2026 01:07
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…ai#11312)

The wsl leg of Clean machine install has failed every completed run since unslothai#10978
added the positive control, on:

    the compiler-intermediate detector is broken: it found 0 of 2 planted files

so the control has never once fired. The check exists because a detector that sees
nothing looks exactly like a clean run and every reason is silent -- and it
reproduced that same problem one level up: writing the files, sweeping %TEMP% and
matching the results all fail as an identical '0 of 2'.

Report all three: how many control files reached disk, how many intermediates the
sweep returned in total, and where it planted them. The next run names its own cause.

Also drop the directory-prefix comparison. The planted files now carry a nonce in
their name and are matched by name, so nothing has to agree on how a directory is
spelled -- %TEMP% on a hosted runner is the 8.3 form (C:\Users\RUNNER~1\...) and
whether an enumerated FullName comes back short or long is not something this check
should bet on. That removes one of the three candidate failure modes; it is not
established as the guilty one.

Verified in pwsh: onDisk=2 sweep=3 seen=2, where the sweep also picks up an
unrelated .rsp, so the match is not just seeing its own files.
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