Skip to content

Keep a count-bounded Iterate's carried order - #171

Open
dcharlot65-openie wants to merge 3 commits into
mainfrom
cursor/c7-count-order-5612
Open

dcharlot65-openie wants to merge 3 commits into
mainfrom
cursor/c7-count-order-5612

Conversation

@dcharlot65-openie

Copy link
Copy Markdown
Contributor

Summary

Erratum of 2026-11-13, adopted by David. C7 used to remove every carried value that neither region uses and both return unchanged, and that removal included the order of a count-bounded Iterate. A count may halt, so that order is the chain the bound halt sits on, even when the test and the body only pass it through. The rule now keeps that carried order. A measure's unused order, and every unused carried value that is not that order, are still removed. FG7, FG8 and the other gates are unchanged.

The four bound sentences

All four said: bound: a count-bounded Iterate must carry ω, and C7 removes a carried ω that neither region uses, so this pure count loop has no applied form. A scan of the 60 examples on the previous checker (examples_are_covered_or_require_change, output captured) hit only the second.

  1. build_count, when the loop would not thread order. Before: 0 example hits. After: if an order is in scope the count carries it and this sentence is gone. If no order is in scope the refusal is omega: a count-bounded Iterate may halt, and this region has no ω to carry.
  2. build_count, after both regions were given order and neither used it. Before: one hit, rt.big.dec in 42_f32.rce (sc_omega=true, parent_omega=true, both regions In(0)), and the pure-count unit test (at=pure, the same shape). After: that sentence is gone. The pure count constructs, the count's first carried type is order, construct(schedule(F)) returns the same bytes, and evaluation agrees with the core for bound 1 (returns 0) and bound 0 (halt loop bound). 42_f32.rce no longer carries the bound tag.
  3. loop_stmt, when the count's regions do not use order. Before: 0 example hits, because the lowering path refused first and no schedule of a pure count was constructed. After: a count whose regions were given order and only pass it through is not refused. The pure count's schedule round-trips, which is this path. If a region was not given order, the refusal is omega: a count-bounded Iterate may halt, and this region has no ω to carry.
  4. loop_stmt, when the count would not carry order (use_w false). Before: 0 example hits. After: the C7 sentence is gone. A count that still does not carry order is refused with omega: a count-bounded Iterate may halt, and this loop's regions do not both carry ω.

The other bound sentence, this loop's regions do not both receive it, is unchanged.

Baselines

Census regenerated by RCE_CENSUS_WRITE from the measured walk, not by editing numbers:

  • 42_f32.rce whole set: bound,break to break. Roots stay clear.
  • exact set bound,break: 1 to 0.
  • exact set break: 14 to 15.
  • catch,global enters the top 10 only because bound,break left that list. It was already an exact set.
  • programs 60, syntactic floor 5, semantic 0, whole 2, whole-entry-only 1, whole-with-user 1. Unchanged.

Witness baseline corpus_baseline_on_50294e05 was re-run and did not move.

Checks

Local runs of the ci.yml jobs passed before push: removed paths, flags, rce-spec-check, book check, claim counts, conformance README, make.py check, T7 (51 equivalent, 0 different), clippy, fast tests, all 12 slow binaries, the wasm checker, and the tree-sitter three-parser check.

Open in Web Open in Cursor 

cursoragent and others added 3 commits November 13, 2026 17:33
C7 removed an order that the test and the body only passed through, so a count that may halt lost the chain that halt sits on. The rule now keeps that order. A pure count is applied, and 42_f32.rce no longer refuses for that reason.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
Both regions of a count are given order together, so the later check that they do not both carry it never ran. A count with no order still refuses, and the tests name that sentence. The notes that still required the old pure-count refusal now follow the erratum. A pass-through bool is still removed.

Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
Main moved to 86b8efc after this branch was cut from 9ef5c38.
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