Skip to content

Conversation

@shaoboyan091
Copy link
Contributor

@shaoboyan091 shaoboyan091 commented Dec 31, 2025

Adds pipeline_immediate.spec.ts to validate immediate data usage in RenderPassEncoder, ComputePassEncoder, and RenderBundleEncoder.

Tests cover:

  • Required immediate data slots are set.
  • Unused variables do not require slots.
  • Pipeline creation fails if shader immediate size exceeds layout limit.
  • RenderBundle execution invalidates pipeline and immediate data state.

Issue: #


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Results for build job (at bed2542):

+webgpu:api,validation,createPipelineLayout:immediate_data_size:* - 8 cases, 8 subcases (~1/case)
+webgpu:api,validation,encoding,programmable,pipeline_immediate:required_slots_set:* - 69 cases, 69 subcases (~1/case)
+webgpu:api,validation,encoding,programmable,pipeline_immediate:unused_variable:* - 18 cases, 18 subcases (~1/case)
+webgpu:api,validation,encoding,programmable,pipeline_immediate:overprovisioned_immediate_data:* - 3 cases, 3 subcases (~1/case)
+webgpu:api,validation,encoding,programmable,pipeline_immediate:pipeline_creation_immediate_size_mismatch:* - 3 cases, 3 subcases (~1/case)
+webgpu:api,validation,encoding,programmable,pipeline_immediate:render_bundle_execution_state_invalidation:* - 4 cases, 4 subcases (~1/case)
-TOTAL: 284493 cases, 2341915 subcases
+TOTAL: 284598 cases, 2342020 subcases

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Adds `pipeline_immediate.spec.ts` to validate immediate data usage in
RenderPassEncoder, ComputePassEncoder, and RenderBundleEncoder.

Tests cover:
- Required immediate data slots are set.
- Unused variables do not require slots.
- Pipeline creation fails if shader immediate size exceeds layout limit.
- RenderBundle execution invalidates pipeline and immediate data state.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'vector',
'struct_padding',
'functions',
'function_unused',
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The 'function_unused' scenario doesn't fit the purpose of the 'required_slots_set' test, which is meant to validate that required immediate data slots are set. This scenario tests when data is NOT statically used and therefore slots are NOT required. Consider moving this scenario to the 'unused_variable' test or removing it if redundant with that test's coverage.

Suggested change
'function_unused',

Copilot uses AI. Check for mistakes.
setImmediates(0, kRequiredSize + 4);
}
} else {
// Vector (size 16), functions (size 16), dynamic_indexing (size 16)
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The comment "Vector (size 16), functions (size 16), dynamic_indexing (size 16)" is incomplete as this else branch also handles the 'function_unused' scenario. Update the comment to explicitly list all scenarios handled in this branch: "Vector (size 16), functions (size 16), function_unused (size 16), dynamic_indexing (size 16)"

Suggested change
// Vector (size 16), functions (size 16), dynamic_indexing (size 16)
// Vector (size 16), functions (size 16), function_unused (size 16), dynamic_indexing (size 16)

Copilot uses AI. Check for mistakes.
@kainino0x
Copy link
Collaborator

Sorry, bit swamped. Should be able to review tomorrow.

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.

2 participants