Accept a git checkout of the SimpleTriangle sample in reference_triangle #151

Merged
rasptum merged 1 commit from upstream-pr/152 into main 2026-11-21 17:44:46 +00:00
rasptum commented 2026-11-21 17:33:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T17:33:40Z.


Change

reference_triangle_hardware and reference_triangle_warp fail for anyone who gets the pinned SimpleTriangle sample with git:

Unexpected reference version: VertexShader.hlsl

Xbox-GDK-Samples declares *.hlsl eol=crlf in its .gitattributes, so a checkout writes the shaders with CRLF whatever core.autocrlf is set to. git check-attr on the pinned commit reports eol: crlf for VertexShader.hlsl. The test compares a byte-for-byte SHA-256 against the LF blobs (673 and 638 bytes), and the checked-out files are 699 and 664 bytes, so the first hash check always throws.

The .hlsl files are now hashed with CRLF folded to LF. media/image1.png is still compared byte for byte. The expected hashes are unchanged. docs/experiments.md gains a sparse-checkout recipe for the default SIMPLE_TRIANGLE_DIR location, which needs no cache entry.

Verification

Windows 10 22H2 (19045.6466), VS Build Tools 17.14, SDK 10.0.26100, RTX 3060 (32.0.15.9636) and WARP 10.0.19041. REFERENCE_POWERSHELL resolved to Windows PowerShell 5.1 (pwsh not installed).

Sample files main This branch
Sparse git checkout at b1e77b6 (CRLF) Both tests fail: Unexpected reference version: VertexShader.hlsl Both pass
Raw blob bytes (LF) Both pass Both pass
CRLF copy with one space added to PixelShader.hlsl Fails Fails: Unexpected reference version: PixelShader.hlsl

The passing runs print channels=10812 source_errors_gt2=0 published_image_errors_gt24=0 mean_abs=6.88 max_abs=17 on both adapters, matching the numbers already in docs/experiments.md.

Evidence and follow-up

No new fixtures. The sample is Microsoft's public Xbox-GDK-Samples at the commit the test already pins. The hash function uses only .NET APIs that Windows PowerShell 5.1 and PowerShell 7 share. I ran it under 5.1. The CI runner's pwsh covers 7 once the sample is present there, but CI does not fetch it today. Fetching it in CI would turn these two tests on for every PR.

AI-assisted (Claude Code); built and run locally on the configuration above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6532158272 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/152). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-21T17:33:40Z. --- ## Change `reference_triangle_hardware` and `reference_triangle_warp` fail for anyone who gets the pinned SimpleTriangle sample with git: ```text Unexpected reference version: VertexShader.hlsl ``` `Xbox-GDK-Samples` declares `*.hlsl eol=crlf` in its `.gitattributes`, so a checkout writes the shaders with CRLF whatever `core.autocrlf` is set to. `git check-attr` on the pinned commit reports `eol: crlf` for `VertexShader.hlsl`. The test compares a byte-for-byte SHA-256 against the LF blobs (673 and 638 bytes), and the checked-out files are 699 and 664 bytes, so the first hash check always throws. The `.hlsl` files are now hashed with CRLF folded to LF. `media/image1.png` is still compared byte for byte. The expected hashes are unchanged. `docs/experiments.md` gains a sparse-checkout recipe for the default `SIMPLE_TRIANGLE_DIR` location, which needs no cache entry. ## Verification Windows 10 22H2 (19045.6466), VS Build Tools 17.14, SDK 10.0.26100, RTX 3060 (32.0.15.9636) and WARP 10.0.19041. `REFERENCE_POWERSHELL` resolved to Windows PowerShell 5.1 (`pwsh` not installed). | Sample files | `main` | This branch | |---|---|---| | Sparse git checkout at `b1e77b6` (CRLF) | Both tests fail: `Unexpected reference version: VertexShader.hlsl` | Both pass | | Raw blob bytes (LF) | Both pass | Both pass | | CRLF copy with one space added to `PixelShader.hlsl` | Fails | Fails: `Unexpected reference version: PixelShader.hlsl` | The passing runs print `channels=10812 source_errors_gt2=0 published_image_errors_gt24=0 mean_abs=6.88 max_abs=17` on both adapters, matching the numbers already in `docs/experiments.md`. ## Evidence and follow-up No new fixtures. The sample is Microsoft's public `Xbox-GDK-Samples` at the commit the test already pins. The hash function uses only .NET APIs that Windows PowerShell 5.1 and PowerShell 7 share. I ran it under 5.1. The CI runner's `pwsh` covers 7 once the sample is present there, but CI does not fetch it today. Fetching it in CI would turn these two tests on for every PR. _AI-assisted (Claude Code); built and run locally on the configuration above._
upstream-sync closed this pull request 2026-11-24 06:41:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!151
No description provided.