-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[naga] Remove non-essential override references via compaction #7703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There is a question what to do about the
I have listed in my order of preference, but I don't have all the context about use cases and build size concerns that might justify one of my non-preferred options. |
Some performance data: compacting all of the wgsl snapshot tests, with the reachability changes (#7674), before this change:
After this change, with
Without the reachability changes, after this change, with
Performance of other stages (with this change; wgsl-in includes a compaction and is ~1% slower, validation and hlsl-out are unchanged):
|
ad6c39a
to
59a2519
Compare
@jimblandy has indicated in Firefox internal chat that he's overwhelmed with taking on review right now, so I'll race 'im on this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first round of review, expecting at least one more: LGTM, minus some nits that we should work out. I don't expect these to be laborious.
PR-level nits:
- This review requests squash-and-merge, but some changes (like breaking out
adjust_doc_comments
) feel like good things to keep as their own commits. Is there a reason you think it's not helpful to keep these separate? CHANGELOG
entries now, please? 😀
I don't think I'll be adding more feedback items, unless my remaining review scope (examining the test coverage) yields something I'm not expecting.
35ee00e
to
872f446
Compare
This comment was marked as resolved.
This comment was marked as resolved.
872f446
to
c2892c8
Compare
Sounds completely reasonable; I'd expect that with the fixup-style commits we've been pushing. 🙂
The merge commit should just be discarded, in the absence of needing to resolve conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a mode to compaction that removes unused functions, global variables, and named types and overrides. This mode is used everywhere except the compaction at the end of lowering, where it is important to preserve unused items for type checking and other validation of the module. Pruning all but the active entry point and then compacting makes `process_overrides` tolerant of missing values for overrides that are not used by the active entry point. Fixes gfx-rs#5885
79b2174
to
78e965e
Compare
Adds a mode to compaction that removes unused functions, global variables, and named types and overrides. This mode is used everywhere except the compaction at the end of lowering, where it is important to preserve unused items for type checking and other validation of the module.
Pruning all but the active entry point and then compacting makes
process_overrides
tolerant of missing values for overrides that are not used by the active entry point.Fixes #5885
This change also removes the
compact
feature from naga (enables the associated code unconditionally) due to the new use of compaction for overrides and lack of clear justification for the feature flag. See the first comment for more discussion.Testing
Adds several cases in the
validation
test to verify that compaction removes references to non-essential overrides. Also enables the relevant CTS tests, which are now passing.Squash or Rebase? Rebase
Important TODOs
compact
within the benchmark added by Update naga benchmarks and add a compaction benchmark #7715 needs to updated with the 2nd argument in this PR.compact
feature (assuming that's what we do).Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.