Skip to content

Solving for inverse. #2637

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Solving for inverse. #2637

wants to merge 1 commit into from

Conversation

chriseth
Copy link
Member

@chriseth chriseth commented Apr 8, 2025

The main obstacle here is solving the following (low_addr is known, inverse is not):

(inverse * (low_addr - 65532) - 1) * (low_addr - 65532) = 0;

This is similar to #2619 but not exactly (maybe we can still combine both):

We try to solve both branches. The RHS just gives us a range constraint low_addr = 65532 - but low_addr was already known (not that this only works for the "only concrete known is known").

On the LHS we can only do the division if we know that low_addr - 65532 is not zero.

This is a slight problem with the new data structures, since we need to solve one branch in the "only concrete is known" version and the other branch in the "also symbolically known is known" version.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: cab979d Previous: efdc4f1 Ratio
jit-witgen-benchmark/jit_witgen_benchmark 10619040669 ns/iter (± 75290523) 7621602996 ns/iter (± 86241071) 1.39

This comment was automatically generated by workflow using github-action-benchmark.

@chriseth chriseth changed the title Test for solving for inverse. Solving for inverse. Apr 9, 2025
@chriseth
Copy link
Member Author

We can probably solve in regular mode and then convert the symbolic expressions to QSEs by translating all references to unknown variables (known concrete variables will not appear anyway!)

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.

1 participant