Skip to content
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

Rename ControlRegion to just Region. #7

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

eddyb
Copy link
Collaborator

@eddyb eddyb commented Nov 5, 2024

Inspired by some ideas around fusing ControlNode+DataInst (as just Node/Op/etc.), and unlike those two there is really no reason to distinguish between "kinds of regions".


Also used this as a test of a new jj feature which allowed me to rebase 50 commits downstream of this painlessly (by preventing the normal propagation of diffs, so each commit could be independently rewritten, and those that haven't been yet would have the opposite rename in their diff):

sed -i -E 's/Control(Region)/\1/g;s/control_(region)/\1/g' README.md src/**.rs \
  && not rg -i 'control.?region' README.md src && cargo fmt --all && cargo check --all \
  && jj restore --from @ --to @- --restore-descendants && jj next

(the new feature being --restore-descendants, which could better be described as "firewall descendants (downstream/future commits) from these changes")

&& jj next at the end only really handles the "main chain" of changes, so after that was done, replacing it with this, at the start, made it possible to chew through the remaining side commits:

jj new 'latest(uncontrol-region+:: & diff_contains(regex:"[cC]ontrol.?[rR]egion"))' && 

@eddyb eddyb enabled auto-merge November 5, 2024 10:57
Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

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

Straightforward. 🚀

@eddyb eddyb added this pull request to the merge queue Nov 5, 2024
@eddyb eddyb added this to the 0.5.0 milestone Nov 5, 2024
Merged via the queue into Rust-GPU:main with commit 7e519e2 Nov 5, 2024
6 checks passed
@eddyb eddyb deleted the uncontrol-region branch November 5, 2024 15:10
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2024
Follow-up to (which has some motivation and methodology):
- #7

The one notable difference is the `print` commit (where `print::Node`
existed and unnecessarily conflicted with `ControlNode` post-rename).
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2024
…`). (#12)

Effectively undoes:
- EmbarkStudios/spirt#28

Some quick unscientific testing reveals no significant perf impact (i.e.
the difference is lost in the noise).

The motivation for undoing this interning is the prospect of combining
`DataInstDef` into `NodeDef` (as mentioned in #7), and for unrelated
pragmatic reasons, `NodeDef` can't have its outputs interned (though
long-term maybe we could intern the `kind` field, if really necessary,
assuming we first take "child regions" out of it).

The one thing I realized too late there's no pre-existing consensus for,
is the `output_type`, which used to be between `kind` and `inputs`
(matching `DataInstFormDef`, in fact), while `NodeDef`'s `outputs` is
the last field.

The only argument to have outputs first is the `let (out0, out1) =
foo(in0, in1);` style syntax (though pretty-printed SPIR-T omits the
`let`), but I'm not sure that's worth flipping the order over.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants