software-mansion / software-mansion/TypeGPU

chore: More strict `std` generator path signatures

Open
#2,924 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
123
Avg merge
3d 5h
Merged PRs (30d)
34

Description

it('...', () => {
  // @ts-expect-error
  expect(() => lt(vec3u(), vec3f())).toThrowErrorMatchingInlineSnapshot(
    `[Error: Unsupported signature. Expected the following kinds to be equal: 'vec3u, vec3f'.]`,
  );

  const f = () => {
    'use gpu';
    const x = vec3u();
    // @ts-expect-error
    return lt(x, vec3f());
  };

  expect(tgpu.resolve([f])).toMatchInlineSnapshot(`
    "fn f() -> vec3<bool> {
      let x = vec3u();
      return (x < vec3f());
    }"
  `);
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the test containing the shown lt, vec3u, and vec3f calls, then trace the std generator path handling used by that test. Run the test and confirm mismatched vector kinds produce the expected TypeScript error and runtime message while the generated fn f() snapshot remains as shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.