Skip to content

TSLANG_ISSUES: four found writing native_ts_graphics' graphics pipeline (14-17) - #566

Merged
ASDAlexander77 merged 1 commit into
mainfrom
tslang-issues-14-17
Oct 13, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
tslang-issues-14-17

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Four tslang issues found while adding NVRHI's graphics pipeline to native_ts_graphics (ASDAlexander77/native_ts_graphics#61), each with a complete repro run on pre-alpha100 and the workaround the project uses:

# Issue
14 A literal-union ternary (x ? 1 : 0) as an integer tuple field fails in codegen: llvm.sext of !ts.union<literal 0, literal 1>, reported at <unknown>:0. #560 fixed the same union for binary operators.
15 u64 * <integer literal> is computed in 32 bits: 2^32 * 2 gives 0, and d *= 256 wraps. With a u64 constant it is right. This cut every debug name native_ts_graphics passed NVRHI to 4 characters.
16 u64 % goes through f64, so it is wrong above 2^53 (w % 256 gives 108 for 109). u64 / always gives a float, so there is no exact integer division.
17 Storing through Ref<u8> indexing (bytes[i] = x) is rejected with "saving to constant object"; reading works. This one is a question: is there a supported way?

🤖 Generated with Claude Code

…ne (14-17)

14: a literal-union ternary as an integer tuple field fails in codegen (llvm.sext of a union,
no location). 15: u64 * an integer literal is computed in 32 bits. 16: u64 % goes through f64,
and u64 / has no integer division. 17: storing through Ref<u8> indexing is rejected. Each with
the repro run on pre-alpha100 and the workaround used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 686d803 into main Oct 13, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the tslang-issues-14-17 branch October 13, 2026 13:55
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