fix(desktop): use DXC for Windows shaders - #2135
Open
Hona wants to merge 2 commits into
Open
Conversation
Comment on lines
+597
to
+600
| if (actualHash !== asset.sha256) | ||
| throw new Error( | ||
| `${asset.name} SHA-256 mismatch: got ${actualHash}, expected ${asset.sha256}`, | ||
| ); |
Contributor
There was a problem hiding this comment.
When the cached DXC package is truncated or corrupted, checksum verification throws without deleting it, so every subsequent Windows setup reuses the same invalid archive and fails until it is manually removed.
Suggested change
| if (actualHash !== asset.sha256) | |
| throw new Error( | |
| `${asset.name} SHA-256 mismatch: got ${actualHash}, expected ${asset.sha256}`, | |
| ); | |
| if (actualHash !== asset.sha256) { | |
| await fs.rm(archivePath, { force: true }); | |
| throw new Error( | |
| `${asset.name} SHA-256 mismatch: got ${actualHash}, expected ${asset.sha256}; removed the invalid cached archive`, | |
| ); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/setup.js
Line: 597-600
Comment:
**Invalid DXC cache persists**
When the cached DXC package is truncated or corrupted, checksum verification throws without deleting it, so every subsequent Windows setup reuses the same invalid archive and fails until it is manually removed.
```suggestion
if (actualHash !== asset.sha256) {
await fs.rm(archivePath, { force: true });
throw new Error(
`${asset.name} SHA-256 mismatch: got ${actualHash}, expected ${asset.sha256}; removed the invalid cached archive`,
);
}
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Author
There was a problem hiding this comment.
Fixed in 7e36577. A checksum mismatch now removes the invalid cached archive before returning the error. I also reproduced the recovery path with a corrupt cache entry and confirmed the archive was deleted.
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.
Fixes #2134
Summary
Use Microsoft's official DXC redistributable for Windows DX12 shader compilation.
Cap keeps the existing WGSL unchanged. Windows setup downloads and verifies the official
Microsoft.Direct3D.DXCNuGet package, stages the matching architecture DLLs, and packages the runtime and license notices with the desktop app. The renderer selects the adjacent DXC pair and falls back to FXC when the bundle is unavailable.Why DXC
The current FXC path spends most of editor startup compiling
composite-video-frame.wgsl. Five runs on the affected NVIDIA RTX 3080 Ti Laptop GPU measured:DXC reduces composite pipeline creation by 99.03%, or 102.9x, without introducing shader variants or changing the blur algorithm.
This option was selected because it:
Rendering verification
A deterministic 360-frame stress sequence exercised directional blur, radial zoom blur, resampling, rounded corners, shadows, borders, color grading, and grain.
Metrics were calculated on raw RGBA frames before video compression:
The compilers produce negligible floating-point differences, but no visible quality regression was found. The full methodology and root-cause analysis are in #2134.
Implementation
Microsoft.Direct3D.DXC1.9.2607.13 from NuGet during Windows native setup.dxcompiler.dllanddxil.dllfor local and target builds.target/*/depstest layout.Validation
cargo fmt --all -- --checkcargo check -p cap-renderingcargo test -p cap-rendering --lib -- --nocapture(151 passed,1 ignored)pnpm dlx @biomejs/biome@2.2.0 check --write scripts/setup.js apps/desktop/scripts/prepare.jsnode --check scripts/setup.jsnode --check apps/desktop/scripts/prepare.jstauri.windows.conf.jsonincludes the DXC DLLs and notices.Greptile Summary
This PR adds a verified Microsoft DXC download and staging flow for Windows, packages the runtime DLLs and notices with the desktop application, and configures the shared renderer to prefer adjacent DXC libraries with an FXC fallback.
Confidence Score: 4/5
The PR appears safe to merge, with a non-blocking cache-recovery issue in the Windows DXC setup flow.
The runtime compiler selection retains an FXC fallback, while the only accepted concern is that a corrupted cached DXC package must be deleted manually before Windows setup can succeed again.
Files Needing Attention: scripts/setup.js
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(desktop): use DXC for Windows shader..." | Re-trigger Greptile