Skip to content

Keep a measure break's flag through the schedule - #172

Open
dcharlot65-openie wants to merge 5 commits into
mainfrom
cursor/mset-flag-index-1893
Open

dcharlot65-openie wants to merge 5 commits into
mainfrom
cursor/mset-flag-index-1893

Conversation

@dcharlot65-openie

@dcharlot65-openie dcharlot65-openie commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Main at 86b8efcf is merged in an ordinary merge (26e47efa). There were no conflicts. The acceptance gate on main does not change the schedule of a measure break. PR 160's literal-placement rule is not in this branch.

The witness that still said a break 1 inside a block was refused is a_break_that_names_the_loop_from_inside_a_block_round_trips. It asserts that the break is the loop flag and that the schedule reads that form back. The round-trip tags on 21_maps.rce (fn freq), 33_in_operator.rce, and 43_simd_lanes.rce are unchanged. No program root's first tag is FG8.

The gate is not changed.

Schedule of fn table

The scheduled core rebuilt the break arm's false as a capture of the output dummy, so FG8 no longer saw a fresh literal on that arm. A bool an arm returns is a node of that arm, including a pure break. A literal the arms only return is one let, and only the arm uses that local, so a later sum.mk still has a literal index. The 1 under int.bad.add stays an atom.

fn table, lowered on its own, round-trips. body_break_rewrite stays set. Core eval, Form eval, and the scheduled core of table() are (a, 1), (b, 2). It does not enter the syntactic floor.

fn freq lowers

(m.get(w) catch 0) + 1 with map values u32 kept both the lit name and u32, so the sum had two check ranges and the file did not lower. Catch already requires the handler to have the success type. A literal handler takes that name. The sum is checked against u32. The reference trace of 21_maps.rce, including probes, matches the lowered core.

fn freq's search break

mfind's second break is a pure break of the search loop. The key is past the probe, so the arm does not step the index. Construction returned that flag as a capture of the parent's dummy false. FG8 reads a literal false in the same region, so fn freq failed at node 3. The arm now stores a fresh false with no inputs. mfind round-trips. fn freq's closure constructs, and the schedule constructs, so the file is not FG8.

The closure's bytes are not identical. The decimal helpers' empty text is the same bits as a branch output's dummy, and the schedule reads that node back in the parent. The root tag is round-trip. This is a loop-body break, not PR 160's non-loop block break.

List catch

A list singleton's initial value is list.new of the element. Both arms that run drop it and store the real sum. An array singleton still has no dummy. observe fn table no longer refuses with catch. The whole module's first refusal is exit.

Census

Floor, whole, and option B are unchanged. No program root's first tag is FG8. The merge and the rename do not move these rows. Head fd9e0056 matches the 0208c624 column.

9ef5c387 c384351c 0208c624 and fd9e0056
programs 60 60 60
floor 5 5 5
option B files 0 0 0
whole 2 2 2
first-tag break 18 18 18
first-tag catch 0 0 0
first-tag FG8 33_in_operator.rce 21_maps.rce, 33_in_operator.rce none
whole-module break 19 19 22
whole-module catch 3 4 0
whole-module global 5 5 5
whole-module out 0 0 0
whole-module schedule FG8 43_simd_lanes.rce 43_simd_lanes.rce none (43_simd_lanes.rce is round-trip)
21_maps.rce lowering (lit mixed with u32) root FG8 at fn freq node 3; whole set catch,exit root round-trip; whole set exit

The nine mismatch names stay in the first-tag round-trip list on every revision above: 03_fib_loop.rce, 10_comptime.rce, 22_tuples.rce, 25_labels.rce, 36_multiline_brackets.rce, 43_simd_lanes.rce, 45_byte_text.rce, 46_u64.rce, 49_loop_limit.rce. 21_maps.rce and 33_in_operator.rce join that list on 0208c624 and stay there on fd9e0056.

Overlap with PR 160

PR 160 is still open. This branch does not rewrite a standalone block break. Both edit schedule_branch. A later merge of PR 160 will conflict there. This merge of main does not take PR 160's literal-placement rule.

Not merged. Not deployed.

Open in Web Open in Cursor 

cursoragent and others added 5 commits November 13, 2026 17:39
The scheduled core of fn table rebuilt the break arm's false as a capture of the output dummy, so the gate no longer saw a fresh literal on that arm. A bool written after the arm has computed something is a node of the arm. A literal the arms only return is named by one let in the parent, and only the arm uses that local, so a later sum.mk still has a literal index.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
`fn freq` adds one to `(m.get(w) catch 0)` where the map values are u32. The handler is a literal, so the typed tree kept both the `lit` name and `u32`, and the sum had two check ranges. Catch already requires the handler to have the success type, so a literal handler takes that name and the sum is checked against u32. The file lowers. `fn freq` still fails FG8 at node 3.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
…mpty.

A pure break arm captured the parent's dummy false, so FG8 did not see a
literal in that region. mfind's search loop is that arm: the key is past
the probe and the index is not stepped. The arm now stores a fresh false
with no inputs, and a captured bool is a node of the arm. The measure
applies, and the schedule reads mfind back as the same bytes.

A list singleton's catch initial is list.new. Both arms that run drop it
and store the real sum. An array still has no dummy.

21_maps.rce is no longer FG8. Its root is round-trip, because the decimal
helpers' empty text does not come back as the same nodes. The whole
module's first refusal is exit.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
The acceptance gate on main does not change the schedule of a measure break.
Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
The witness checks that the break is the loop flag and that the schedule reads that form back. The old name still said the schedule was refused.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>

This branch has not been deployed

No deployments
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