Repository navigation
int_proxy reduce: witness interesting times with novel records, not bare times - #1114
Draft
frankmcsherry wants to merge 1 commit into
Draft
frankmcsherry wants to merge 1 commit into
frankmcsherry wants to merge 1 commit into
Conversation
…are times The proxy reduce marked interesting times with the raw novel time support, held as bare times in the seed list and in `reached`, and kept visited synthetic times there too. A bare time never cancels, so a record inserted and retracted within one round kept every later time it joined interesting. On a one-round diagonal workload (each record lives for one step of the first coordinate) that is about n²/2 evaluations, where single steps take about 3n. The window now carries the novel records alone, `ReduceWindow::novel`, consolidated among themselves but not netted against the prior history. The sweep holds them in a `ValueHistory` advanced by the running meet, so an insertion and its retraction cancel once the meet moves them to one time, and then witness nothing. Due times stay bare seeds. Visited synthetic times are no longer kept in `reached`; corrections emitted this round witness later times and join with every time instead. This is the proxy counterpart of the cursor change in #1113, and reads `round_coverage` at the finer grain that `meet_view_agrees` in `formal/Differential/Model.lean` permits. The vec backend, `BackendFrontier`, and DDIR's corgi backend present the new channel. `reduce_scaling_cancelled_history` runs the diagonal at n = 100,000 in one round. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
The proxy reduce is quadratic on a one-round workload where records come and go, because it marks interesting times with bare times, which never cancel.
This PR marks them with the round's novel records instead, which cancel once the running meet moves an insertion and its retraction to one time.
It is the proxy counterpart of #1113, built on master-next independently of it.
Problem
The workload is a diagonal, all in one round.
At step
i, record2iis present at(i, 0)and record2i+1at(i, n+1-i), and both are retracted at stepi+1.The live collection stays the same size throughout.
The seed list holds the novel time support as bare times, and
reachedkeeps every seed it consumes, plus every visited synthetic time.Advanced by the meet, the insertion time of record
2i+1becomes(s, n+1-i), which is distinct for eachi.So
reachedkeeps one entry per earlier record, every later time joins against all of them, and every join counts as reached.Change
ReduceWindow::seeds: Vec<(K, T)>becomesnovel: ProxyBridge<T, RIn, K, VIn>: the novel records alone, consolidated among themselves and not netted against the prior history.inputis unchanged, still merged and netted as in Extract novel times explicitly #830.ValueHistory. It is a frontier source, is stepped inabsorb, joinssettle's meet, and has its buffer advanced and consolidated in everysettle.reached. Visited synthetic times are no longer kept there.closejoins every time withreached, the novel buffer andproduced. Reached times also join with the input and output buffers, as before.BackendFrontierreads them as ofsince.reduce_scaling_cancelled_historyintests/int_proxy.rsruns the diagonal at n = 100,000 in one round.Measurements
Logic calls on the diagonal in one round, release build, vec backend:
That is exactly (n+1)(n+4)/2 + n + 2 calls before, and 3n + 4 after.
In a debug build, the new test takes 2.1 s at n = 100,000; master-next takes 39 s at n = 1,000 and 307 s at n = 2,000.
The proxy benches in
int_proxy_bench, single runs, µs per round, master-next then this PR:Multimoment looks about 10% slower.
Likely causes are the second presentation of the novel records and consolidating their buffer at every step; it is not profiled.
Checks
Uncommitted scratch harnesses, run in debug against an oracle:
fuzz_proxy_maxand a newfuzz_proxy_churneach pass 50,000 seeds. Churn makes 720,951 logic calls against 724,504 on master-next.fuzz_proxy_maxfailuresfuzz_proxy_churnfailuresproducedjoins only at reached timesproducedno longer marks timesThe tests also pass:
reduce_seed_survives_cancellation.Open questions
producedpieces needed: marking later times, and joining with unreached times? Removing them causes no failures, and n = 1,000 still costs 3,004 calls. Without them, the handling ofproducedmatches master-next. reduce: stop keeping visited synthetic times as witnesses #1113 adds the same two pieces to the cursor. They are kept here until there is an argument either way.producedis still compacted only when corrections are added, as in reduce: stop keeping visited synthetic times as witnesses #1113's first question.producedcounts as prior". That second one becomes true again if question 1 drops the two pieces.As in #1113, the step from this sweep to
formal/is informal.The
Sweepdoc now readsround_coverageat the finer grain thatmeet_view_agreesinModel.leanpermits.🤖 Generated with Claude Code