Repository navigation
Conversation
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there, here is a proposed fix for this issue.
Fixes #1444
Following the suggestion in #935, this adds a proc next to the existing function versions in
xls/examples/gcd.x. It takes(a, b)on a request channel, does one Euclidean step per tick ((a, b)becomes(b, a % b)), and sendsaon the result channel oncebis zero. It only accepts a new request while idle. That gives a data dependent number of ticks, which is the tradeoff against the fixed latency ofgcd_euclideanthat the issue wanted to show.Changes are all in
gcd.x, so the existinggcd_testrule picks them up and no BUILD edit is needed:gcd_euclidean_proc<N>#[test]proc covering 48/18, 18/48,b == 0anda == 0#![feature(...)]lines the other proc examples use (explicit_state_access,generics)What I ran, on my fork's GitHub Actions (Ubuntu) with the
interpreter_mainanddslx_fmtbinaries from the release built at 753a8f1, which is the commit this branch is based on: https://github.com/MaxonT/xls/actions/runs/46273197446interpreter_main --compare=jit gcd.x, the same flags asgcd_test: 3 tests ran, 0 failed, and the 50000 case quickcheck passed.a % btoa / bin the proc makesgcd_euclidean_proc_testfail (u8:9vsu8:6), so the test does exercise the proc.dslx_fmton the file gives no diff.Not run: the Bazel build and
bazel test //xls/examples:gcd_testitself, upstream CI, and IR conversion or codegen of the new proc (no BUILD rule is added for it).