microsoft / microsoft/DirectXShaderCompiler

[Feature Request] Diagnostic for missing `MaxRecords`

Open
#6,328 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

diagnostic enhancement sm6.8
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Is your feature request related to a problem? Please describe.
[MaxRecords()] on node inputs has an implicit default size of 1 (as per spec.) This is very rarely what the user actually wanted, especially for coalescing nodes.

Describe the solution you'd like
A diagnostic which warns that no MaxRecords() annotation was found and thus 1 was implied.

Describe alternatives you've considered
Forbidding to have no MaxRecords(), but it actually makes sense for outputs to have the implicit 1 for convenience. There's not much design space left here.

Additional context
A coalescing node with a MaxRecords(1) is probably better off as a thread launch node, so the diagnostic could mention that.

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

Start by locating the compiler entry point that processes MaxRecords annotations and compare its behavior with the linked Work Graphs specification. Add a diagnostic when a node input lacks MaxRecords(), including the implicit value of 1, and consider the requested coalescing-node guidance; done means the warning appears for the missing annotation without changing the output default.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.