Repository navigation
Keep a returning arm out of the join's carried state - #174
Open
dcharlot65-openie wants to merge 3 commits into
Open
dcharlot65-openie wants to merge 3 commits into
dcharlot65-openie wants to merge 3 commits into
Conversation
A join sealed the return value onto the returning arm and the carried slots onto the arm that falls through, so the widths differed. The return is now its own channel, and the carried slots come from the arms that fall through. Return stays distinct from break and from continue. Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
Main moved when PR 154 landed. This keeps the return channel on the current tip. Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
…ytes. A returning arm's false flag was rebuilt as a capture of the branch dummy, and the measure then failed FG8. That dummy is now a bool the arms do not capture, so the arm keeps its own literal. A parent literal that an arm only returns stays a let in the parent. The return tests assert construct(schedule(F)) equals F. Co-authored-by: David Charlot <dcharlot65-openie@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.
Fixes the join in issue 163. A returning arm no longer adds its return to the carried slots. The return stays a return, distinct from break and from continue. The gates are unchanged.
Under section 13,
construct(schedule(F))equalsFbyte for byte for every form this change admits. The six return tests assert those bytes.Main at
86b8efcf(PR 154) is merged in with an ordinary merge commit07afb055. PR 160 and PR 171 are still open.Scopehasearlyand does not yet havecarrying.Root cause
On main
9ef5c387,finish_ifinspec/checker/src/form/bridge.rssealsEnd::Retby pushing the return value, then ω when the region has ω. The arm that falls through pushes the carried slots. Forrt.text.isdigitandrt.text.findthose slots are ω alone, so the join expects 1 output. The returning arm presents 2 values and the fall-through arm presents 1.Measured on that revision, before this change:
rt.text.isdigit:join_flagfalse,needs_wtrue,varsempty,e0isRet,e1isFall, outputs 2 and 1 for 1 output.rt.text.find: the same join, with the arms swapped, outputs 1 and 2 for 1 output.What changed
The carried slots are taken from arms that fall through. A returning arm passes those slots through and does not place the return among them. The return is two further outputs of the same branch: a continue flag that is false on the returning arm, and the return value. A break still uses its own flag.
join_flagtogether withRetstays refused. The gate is not edited.A loop carries that channel out. The function return selects the early value when the flag is false, and the caller's own return when the flag is true.
The schedule of that channel has to construct back to the same form.
rt.text.findrebuilt-1inside the selecting arm. The schedule now binds that literal with aletin the parent, and the arm returns the local.Overlap with PR 160 and PR 172
This change edits
schedule_branch. PR 172 also edits that function: it lifts a non-bool capture the arms return, and it builds a fresh bool inside an arm. The two lifts meet in the same function. If PR 172 lands on main before this branch is green, an ordinary merge keeps both. Do not rebase. The return-flag dummy stays on this branch. PR 172's fresh bool inensure_litstays on that branch. One parent literal should be onelet.The overlap with PR 160 is the
Scopevalue inspec/checker/src/form/bridge.rs. PR 160 addscarrying. This branch addsearly. The literals are the same sites, including the scopes insidefinish_if. If PR 160 lands, an ordinary merge keeps both fields.Census
Command, from
spec/checker:The checker and the examples are the same bytes on
9ef5c387and on main86b8efcf. The command passed on main86b8efcf(678.40s) and on this head (502.55s). The pins are unchanged.86b8efcf09_generics,35_nested_if)33_in_operatorconstructs)breakFG833_in_operator33_in_operatordefect06_option,07_error_union,20_strings07_error_unionloop50_iterators,55_rcedb06_optionand20_stringsdefect07_error_union,20_strings,33_in_operator07_error_union,20_stringsFG843_simd_lanes33_in_operator,43_simd_lanes51_refined_input.rceleaves the defect set. Census line 145 is wholebreak,exitand rootsbreak.33_in_operator.rcestill refuses at the module with FG8, so it is not on the syntactic floor. Its root set wasFG8,round-tripand is nowFG8, because thert.text.findclosure constructs back to the same bytes.07_error_unionstill refuses: the root tag staysdefect, and the whole-module set staysdefect,exit,loop. Thert.text.isdigitclosure constructs back to the same bytes.06_optionand20_stringsmove from a rootdefecttoloopbecause construction reaches the next refusal. They do not become whole. The form-bridge header counts stay programs 60, floor 5, semantic 0, whole 2.Checks run here
cargo test --release --test break_fg8_witness corpus_baseline_on_50294e05 -- --test-threads=1(passed, 502.55s)cargo test --release --test form_bridge examples_are_covered_or_require_change(rewrote the33_in_operatorroot set, then passed)cargo test --test break_fg8_witness -- --skip corpus_baseline(17 passed)cargo test --test form_bridge -- --skip examples_are_covered(38 passed)python3 scripts/check-removed-paths.pyandpython3 scripts/check-flags.py(passed)Not merged. Not deployed.