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

start a blog post draft on the optimization rule dsl #141

Merged
merged 6 commits into from
Oct 23, 2024
Merged

Conversation

cfbolz
Copy link
Member

@cfbolz cfbolz commented Oct 22, 2024

No description provided.

Copy link
Contributor

@tekknolagi tekknolagi left a comment

Choose a reason for hiding this comment

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

Love this. Publish it! Nits only

posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Show resolved Hide resolved
Adding more rules to these functions was very tedious and got super confusing
after a while. In addition I was worried about making mistakes when writing this
kind of code, and I had basically no feedback at all about which of these rules
are actually applied a lot in real programs.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mention boat beer chat? :D

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, I forgot. what did we discuss on the boat that was relevant?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something John was working on that inspired this whole z3 adventure

constant zero. After the ``=>`` arrow is the target of the rewrite, i.e. what the
operation is rewritten to, in this case ``x``.

The rule language knowns which of the operations are commutative, so ``add_zero``
Copy link
Contributor

Choose a reason for hiding this comment

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

how does it know which are commutative?

Copy link
Contributor

Choose a reason for hiding this comment

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

also does this mean if you have nesting depth K for commutative operations then it will try all versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

there's simply a list of commutative versions ;-). I added that.

about nesting, yeah, all the commutative combinations of the operation names that appear in the head of the rule are tried. not sure where to write that though.

posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
posts/2024/10/jit-peephole-dsl.rst Outdated Show resolved Hide resolved
@tekknolagi
Copy link
Contributor

Great stuff. Looking forward to seeing it live

@cfbolz cfbolz marked this pull request as ready for review October 23, 2024 15:03
@cfbolz cfbolz merged commit 032dc1c into main Oct 23, 2024
6 checks passed
@cfbolz cfbolz deleted the 2024-jit-dsl branch October 23, 2024 15:05
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