software-mansion / software-mansion/TypeGPU
bug: unary operator `-` of u32
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
This code resolves to invalid wgsl
const seedSaltZ = 0xbca0294b | 0;
const foo = () => {
'use gpu';
const x = d.u32();
return x ^ seedSaltZ;
};
console.log(tgpu.resolve([foo]));
fn foo() -> u32 {
const x = 0u;
return (x ^ -1130354357u);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TypeScript reproducer and the tgpu.resolve entry point, then trace how the unary - expression on the u32 value is emitted. Done means the example resolves to valid WGSL, with a regression test covering the generated expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100