Repository navigation
Drop an owned catch sum on the arm that does not read it - #179
Open
dcharlot65-openie wants to merge 1 commit into
Open
dcharlot65-openie wants to merge 1 commit into
dcharlot65-openie wants to merge 1 commit into
Conversation
fn use_it catches divmod into a pair. The success arm reads the sum and the handler builds (0, 0), so one path left the sum live and the unreachable tag arm dropped it. W3 refused the schedule. A falling arm now drops an owned value the other falling arm has already moved, and the proof arm drops only those values, so both paths meet with the same ownership. 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.
fn use_itin22_tuples.rceschedules again. The handler ofdivmod(17, 5) catch (0, 0)builds its own pair and does not read the catch sum. The success arm does. W3 is unchanged.Root cause
On main
86b8efcfthe schedule offn use_itrefused with:defect: the schedule is not well formed: ... W3: the paths that meet after an if hold different owned values ({1: Live, 3: Dead, 4: Live} and {1: Dead, 3: Dead, 4: Live})The locals are the catch sum (
v1), the dummy tuple consumed by the outputvar(v3), and thatvar(v4). The core is:sum.getand stores the pair(0, 0)and does not mention the sumThe inner
iftherefore meets withv1live on the handler and dead on the proof arm. The Form already ends an unused owned value when the region ends. The schedule wrote that drop only on the proof arm.What changed
When both arms fall through, an owned value that one arm has moved is dropped on the arm that still holds it. A value both arms still hold stays, because the parent uses it after the branch. The proof arm drops only the values the falling real arm has already moved. It no longer drops a capture that arm still holds. W3, FG7, FG8, and C7 are not edited.
A handler that does not read the sum round-trips:
construct(schedule(F)) == F, and the scheduled core returns 5.fn use_itnow schedules and returns 5 (3 + 2). Its closure still differs in bytes becausefn divmodalready did, on this same base.Overlap
PR 160 records this W3 split as still open and does not change it. This branch does not restructure a non-loop block break. Both branches edit the proof arm in
schedule_branch; the drop set is the change here.PR 174 keeps a returning arm out of the join. This branch does not change that seal.
Census
86b8efcfb0d69f0422_tuples.rcewholedefectround-trip22_tuples.rcerootsdefect,round-tripround-tripround-tripdefectround-tripdefect,round-tripwholestays 2. The syntactic floor stays 5.fn use_itis not whole:fn divmodis still a byte mismatch.Checks
Release, on this head:
break_fg8_witness: 14 passedform_bridge: 39 passedone_lower: 8 passedtyped_tree: 2 passedcheck-flags.py: 0check-removed-paths.py: 0Not merged. Not deployed.