Skip to content

spirv_metal_set0: preserve carriage returns in quoted operands - #9034

Open
Barbital11111 wants to merge 2 commits into
ItsNotRexed:mainfrom
Barbital11111:fix/metal-spirv-quoted-cr
Open

Barbital11111 wants to merge 2 commits into
ItsNotRexed:mainfrom
Barbital11111:fix/metal-spirv-quoted-cr

Conversation

@Barbital11111

Copy link
Copy Markdown
Contributor

Summary

Disassembly can contain literal CR and CRLF bytes in quoted SPIR-V names. The Metal set-0 wrapper converted those bytes to LF while normalizing line endings, producing valid SPIR-V with a different string operand.

Split the assembly at line endings outside quoted strings. Keep escaped quotes and semicolons in the operand, and recognize comments outside strings.

Depends on: #8730

Coordination claim | Independent review finding

Validation

  • Windows 11, CPython 3.14.3: 46 focused tests passed and 4 skipped because native SPIRV-Tools were unavailable. On the prior head the new CR and CRLF cases failed while the LF control passed.
  • WSL Ubuntu, CPython 3.12.3, SPIRV-Tools v2023.6, ASCII Python locale: real assemble, rewrite and validate passed for all three variants. The binary OpName bytes matched the input exactly and the sampler moved to binding 4096 in each case.
  • Simulated merges with spirv_metal_set0: declare the missing descriptor-array length type #8548 and spirv_metal_set0: publish assembled output atomically #8882 were clean. git diff --check and the changed-file no-game-data check passed. CPU only, synthetic modules.

AI-assisted (Codex).

@catminou4

Copy link
Copy Markdown

Tested on Apple M1 Max, macOS 27.2.1 arm64, Python 3.12.16: python -I tests/test_spirv_metal_set0_extra.py → 26 tests OK — including the staging assertions that were red on macOS under #8882's earlier head, so the CR-preservation change keeps them green here. No game files. AI-assisted (Devin).

@Grimkeh Grimkeh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Linux CPU review

What changed: spirv_metal_set0 preserves carriage returns in quoted operands.

Checked: tests/test_spirv_metal_set0_extra.py — 26 passed.

Looks correct; no game 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.

3 participants