From 7a9fe3a4b2f31e64a2f609babf1c20209ac458da Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 23:00:31 -0800 Subject: [PATCH 1/3] linesweeper: the left intersection scan in docs/sweep.typ uses alpha^(i+1) The pseudocode for the intersection scan to the left looped j = i down to 1 and compared each alpha^j with alpha^i, so its first pass compared alpha^i with itself. The lemma after it is stated for alpha^(i+1), the segment being inserted to the right of alpha^i. The loop body now uses alpha^(i+1), and w^j is the smallest event height between j and i+1. SOURCE.json records the patch in local_patches and the new sha256 of docs/sweep.typ. README.craft.md and NOTICE say one file is changed. --- NOTICE | 8 ++++---- vendor/linesweeper/README.craft.md | 16 ++++++++++------ vendor/linesweeper/SOURCE.json | 6 ++++-- vendor/linesweeper/docs/sweep.typ | 10 +++++----- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/NOTICE b/NOTICE index bd88d43e7..e830ba21f 100644 --- a/NOTICE +++ b/NOTICE @@ -218,10 +218,10 @@ applications retain their own document-font selection and licensing policy. linesweeper linesweeper 0.5.0 (https://crates.io/crates/linesweeper/0.5.0), MIT OR Apache-2.0, is stored in -vendor/linesweeper with its upstream license files and no file changed. Its manifest names Joe Neeman -as author, and its LICENSE-MIT reads "Copyright (c) 2018 Raph Levien". See -vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance and the files -left out. +vendor/linesweeper with its upstream license files and one local patch, to docs/sweep.typ. Its +manifest names Joe Neeman as author, and its LICENSE-MIT reads "Copyright (c) 2018 Raph Levien". See +vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance, local changes +and the files left out. Platform lifecycle source provenance diff --git a/vendor/linesweeper/README.craft.md b/vendor/linesweeper/README.craft.md index f683ca53d..d08f25709 100644 --- a/vendor/linesweeper/README.craft.md +++ b/vendor/linesweeper/README.craft.md @@ -1,15 +1,19 @@ # Local linesweeper 0.5.0 copy -This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and no +This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and one file changed. `.cargo_vcs_info.json` names the commit it was packaged from, `824b0791a750f7b27b8edcbb6c6244d0e629875e`. That commit is not in the GitHub repository the manifest names, which is archived; its README says development moved off GitHub. -Every file here except this one and `SOURCE.json` is byte for byte the file in the `.crate` archive. -`SOURCE.json` records the hash of the `.crate` download (`source_archive_sha256`) and, for every file -kept, the hash in the package (`source_sha256`) and the hash here (`sha256`). `upstream_repository` is -null because no public repository this copy can name holds `upstream_revision`. `local_patches` is -empty. +Every file here except this one, `SOURCE.json` and `docs/sweep.typ` is byte for byte the file in the +`.crate` archive. `SOURCE.json` records the hash of the `.crate` download (`source_archive_sha256`) +and, for every file kept, the hash in the package (`source_sha256`) and the hash here (`sha256`). +`upstream_repository` is null because no public repository this copy can name holds +`upstream_revision`. `local_patches` lists each change: + +- `docs/sweep.typ`: the intersection scan to the left compares each segment with `alpha^(i+1)` + instead of `alpha^i`. With `alpha^i`, its first pass compared `alpha^i` with itself, and the lemma + after it is stated for `alpha^(i+1)`. `omitted_files` lists the 43 files of the package left out here, with their hashes: diff --git a/vendor/linesweeper/SOURCE.json b/vendor/linesweeper/SOURCE.json index 9c71e51ad..5c98f9209 100644 --- a/vendor/linesweeper/SOURCE.json +++ b/vendor/linesweeper/SOURCE.json @@ -7,7 +7,9 @@ "upstream_repository": null, "upstream_revision": "824b0791a750f7b27b8edcbb6c6244d0e629875e", "upstream_directory": "", - "local_patches": [], + "local_patches": [ + "In `docs/sweep.typ`, the intersection scan to the left compares each segment with `alpha^(i+1)`, the segment the lemma after it is stated for, instead of `alpha^i`." + ], "files": [ { "path": ".cargo_vcs_info.json", "source_sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc", "source_git_blob": null, "sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc" }, { "path": ".gitignore", "source_sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0", "source_git_blob": null, "sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0" }, @@ -21,7 +23,7 @@ { "path": "benches/linebender_logo.rs", "source_sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3", "source_git_blob": null, "sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3" }, { "path": "benches/painted_dreams.rs", "source_sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf", "source_git_blob": null, "sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf" }, { "path": "benches/synthetic.rs", "source_sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810", "source_git_blob": null, "sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810" }, - { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3" }, + { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "571f227f4b43eaba8060c48344e26b639a4fea8787e5c63bd3f826836c5e4806" }, { "path": "examples/boolean_op.rs", "source_sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f", "source_git_blob": null, "sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f" }, { "path": "examples/bus.rs", "source_sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33", "source_git_blob": null, "sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33" }, { "path": "examples/curve_metrics.rs", "source_sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2", "source_git_blob": null, "sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2" }, diff --git a/vendor/linesweeper/docs/sweep.typ b/vendor/linesweeper/docs/sweep.typ index 0f83ac1c6..0c1df1d3d 100644 --- a/vendor/linesweeper/docs/sweep.typ +++ b/vendor/linesweeper/docs/sweep.typ @@ -368,13 +368,13 @@ of the other one. #figure( pseudocode-list([ + *for* $j = i$ down to $1$ - + let $w^j$ be the smallest height of any event between $j$ and $i$ + + let $w^j$ be the smallest height of any event between $j$ and $i+1$ - + *if* $(alpha^j_(-,epsilon), alpha^i)$ cross by $w^j$ - + choose $z$ before the crossing, such that $alpha^j approx_(z,epsilon) alpha^i$ - + insert an intersection event for $(alpha^j, alpha^i)$ at $z$ + + *if* $(alpha^j_(-,epsilon), alpha^(i+1))$ cross by $w^j$ + + choose $z$ before the crossing, such that $alpha^j approx_(z,epsilon) alpha^(i+1)$ + + insert an intersection event for $(alpha^j, alpha^(i+1))$ at $z$ - + *if* $alpha^j_+ (z) <= alpha^i (z)$ for all $z in [y, w^j]$ + + *if* $alpha^j_+ (z) <= alpha^(i+1) (z)$ for all $z in [y, w^j]$ + *break* ]), caption: "Intersection scan to the left" From 95fa868c6eb2d2feadeec578e61674c23ab6b8bf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 10 Nov 2026 22:46:50 -0800 Subject: [PATCH 2/3] linesweeper: docs/sweep.typ spells "conditions" and names q(i+1) Two typos in docs/sweep.typ are corrected: "condi0.2tions" reads "conditions", and the insertion-position argument says q(i+1) is false instead of q(i+i). SOURCE.json records the new sha256 of docs/sweep.typ and the change in local_patches, and README.craft.md lists it. --- vendor/linesweeper/README.craft.md | 2 ++ vendor/linesweeper/SOURCE.json | 5 +++-- vendor/linesweeper/docs/sweep.typ | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vendor/linesweeper/README.craft.md b/vendor/linesweeper/README.craft.md index d08f25709..4dcc84fb6 100644 --- a/vendor/linesweeper/README.craft.md +++ b/vendor/linesweeper/README.craft.md @@ -14,6 +14,8 @@ and, for every file kept, the hash in the package (`source_sha256`) and the hash - `docs/sweep.typ`: the intersection scan to the left compares each segment with `alpha^(i+1)` instead of `alpha^i`. With `alpha^i`, its first pass compared `alpha^i` with itself, and the lemma after it is stated for `alpha^(i+1)`. +- `docs/sweep.typ`: two typos are corrected. "condi0.2tions" reads "conditions", and `q(i+i)` reads + `q(i+1)`, the first index for which `q` is false. `omitted_files` lists the 43 files of the package left out here, with their hashes: diff --git a/vendor/linesweeper/SOURCE.json b/vendor/linesweeper/SOURCE.json index 5c98f9209..c3175d996 100644 --- a/vendor/linesweeper/SOURCE.json +++ b/vendor/linesweeper/SOURCE.json @@ -8,7 +8,8 @@ "upstream_revision": "824b0791a750f7b27b8edcbb6c6244d0e629875e", "upstream_directory": "", "local_patches": [ - "In `docs/sweep.typ`, the intersection scan to the left compares each segment with `alpha^(i+1)`, the segment the lemma after it is stated for, instead of `alpha^i`." + "In `docs/sweep.typ`, the intersection scan to the left compares each segment with `alpha^(i+1)`, the segment the lemma after it is stated for, instead of `alpha^i`.", + "In `docs/sweep.typ`, the typo \"condi0.2tions\" reads \"conditions\", and `q(i+i)` reads `q(i+1)`, the first index for which `q` is false." ], "files": [ { "path": ".cargo_vcs_info.json", "source_sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc", "source_git_blob": null, "sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc" }, @@ -23,7 +24,7 @@ { "path": "benches/linebender_logo.rs", "source_sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3", "source_git_blob": null, "sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3" }, { "path": "benches/painted_dreams.rs", "source_sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf", "source_git_blob": null, "sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf" }, { "path": "benches/synthetic.rs", "source_sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810", "source_git_blob": null, "sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810" }, - { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "571f227f4b43eaba8060c48344e26b639a4fea8787e5c63bd3f826836c5e4806" }, + { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "b9bb12076458469869e3e7723598d35ae391307bf22ea312f1b989949e9829a1" }, { "path": "examples/boolean_op.rs", "source_sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f", "source_git_blob": null, "sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f" }, { "path": "examples/bus.rs", "source_sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33", "source_git_blob": null, "sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33" }, { "path": "examples/curve_metrics.rs", "source_sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2", "source_git_blob": null, "sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2" }, diff --git a/vendor/linesweeper/docs/sweep.typ b/vendor/linesweeper/docs/sweep.typ index 0c1df1d3d..78b589504 100644 --- a/vendor/linesweeper/docs/sweep.typ +++ b/vendor/linesweeper/docs/sweep.typ @@ -555,7 +555,7 @@ height. Note that because the sweep line changes at a discrete set of heights, at every important height $y$ we actually have two weakly-ordered sweep line: the "old" one from infinitesmally before $y$ height and the "new" one from $y$ onwards. Because everything is continuous and the weak ordering conditions are -closed, both the old and new sweep lines satisfy the weak ordering condi0.2tions +closed, both the old and new sweep lines satisfy the weak ordering conditions at $y$. The algorithm goes like this: at every important height we use @@ -623,7 +623,7 @@ Let's check that this insertion position is valid: for every $j <= i$ we have either $j <= i_-$ or $i_- < j <= i$. In the first case, we already observed that $alpha^j_-(y) <= beta(y)$; in the second case, $q(j)$ returned `true` and so $alpha^j_-(y) <= beta^j^+ (y)$. In either case, $alpha^j prec.tilde beta$. -On the other hand, $q(i+i)$ being `false` implies that $alpha^(i+1)_- (y) >= +On the other hand, $q(i+1)$ being `false` implies that $alpha^(i+1)_- (y) >= beta(y)$. This implies that for all $j >= i+1$, $alpha^j_+ (y) >= beta(y)$ and so $alpha^j succ.tilde_y beta$. From e314c9a4f20288c9e7e9e492eec713d2353835db Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 11 Nov 2026 21:37:35 -0800 Subject: [PATCH 3/3] linesweeper: the left-scan lemma in docs/sweep.typ takes ordering on alpha^(i+1) The lemma for the intersection scan to the left asked for the ordering invariant on (alpha^1, ..., alpha^i) and the crossing invariant on (alpha^1, ..., alpha^(i+1)). The bidirectional lemma applies it with alpha^(i+1) = beta before the extended list is known to satisfy the crossing invariant, so the premises now mirror the right scan: ordering on (alpha^1, ..., alpha^(i+1)), crossing on (alpha^1, ..., alpha^i). The argument that the order invariant holds between events cited a "third invariant"; the document defines two, and it now cites the crossing invariant. SOURCE.json gets a local_patches entry and the new sha256 of docs/sweep.typ, and README.craft.md lists the change. --- vendor/linesweeper/README.craft.md | 4 ++++ vendor/linesweeper/SOURCE.json | 5 +++-- vendor/linesweeper/docs/sweep.typ | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/vendor/linesweeper/README.craft.md b/vendor/linesweeper/README.craft.md index 4dcc84fb6..93afa58f1 100644 --- a/vendor/linesweeper/README.craft.md +++ b/vendor/linesweeper/README.craft.md @@ -16,6 +16,10 @@ and, for every file kept, the hash in the package (`source_sha256`) and the hash after it is stated for `alpha^(i+1)`. - `docs/sweep.typ`: two typos are corrected. "condi0.2tions" reads "conditions", and `q(i+i)` reads `q(i+1)`, the first index for which `q` is false. +- `docs/sweep.typ`: the lemma for the intersection scan to the left asks for the ordering invariant on + `(alpha^1, ..., alpha^(i+1))` and the crossing invariant on `(alpha^1, ..., alpha^i)`, which is how + the bidirectional lemma uses it. The argument for the order invariant cites the crossing invariant + instead of a "third invariant"; the document defines two. `omitted_files` lists the 43 files of the package left out here, with their hashes: diff --git a/vendor/linesweeper/SOURCE.json b/vendor/linesweeper/SOURCE.json index c3175d996..e88570f04 100644 --- a/vendor/linesweeper/SOURCE.json +++ b/vendor/linesweeper/SOURCE.json @@ -9,7 +9,8 @@ "upstream_directory": "", "local_patches": [ "In `docs/sweep.typ`, the intersection scan to the left compares each segment with `alpha^(i+1)`, the segment the lemma after it is stated for, instead of `alpha^i`.", - "In `docs/sweep.typ`, the typo \"condi0.2tions\" reads \"conditions\", and `q(i+i)` reads `q(i+1)`, the first index for which `q` is false." + "In `docs/sweep.typ`, the typo \"condi0.2tions\" reads \"conditions\", and `q(i+i)` reads `q(i+1)`, the first index for which `q` is false.", + "In `docs/sweep.typ`, the lemma for the intersection scan to the left asks for the ordering invariant on `(alpha^1, ..., alpha^(i+1))` and the crossing invariant on `(alpha^1, ..., alpha^i)`, as the bidirectional lemma uses it, and the argument for the order invariant cites the crossing invariant instead of a \"third invariant\"." ], "files": [ { "path": ".cargo_vcs_info.json", "source_sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc", "source_git_blob": null, "sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc" }, @@ -24,7 +25,7 @@ { "path": "benches/linebender_logo.rs", "source_sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3", "source_git_blob": null, "sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3" }, { "path": "benches/painted_dreams.rs", "source_sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf", "source_git_blob": null, "sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf" }, { "path": "benches/synthetic.rs", "source_sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810", "source_git_blob": null, "sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810" }, - { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "b9bb12076458469869e3e7723598d35ae391307bf22ea312f1b989949e9829a1" }, + { "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "c151c2c47032eca41914139b105177d10996b6ece9c93622aaeb31a371cfe17b" }, { "path": "examples/boolean_op.rs", "source_sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f", "source_git_blob": null, "sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f" }, { "path": "examples/bus.rs", "source_sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33", "source_git_blob": null, "sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33" }, { "path": "examples/curve_metrics.rs", "source_sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2", "source_git_blob": null, "sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2" }, diff --git a/vendor/linesweeper/docs/sweep.typ b/vendor/linesweeper/docs/sweep.typ index 78b589504..c77f6cdc6 100644 --- a/vendor/linesweeper/docs/sweep.typ +++ b/vendor/linesweeper/docs/sweep.typ @@ -221,7 +221,7 @@ The first observation is that the sweep line invariants are maintained as we inc to the next event: + For the order invariant, first note that there is an event whenever $y$ leaves the domain of a segment, so $y$ remains in all domains until the next event. Moreover, if at any $y' > y$ the ordering breaks, two line segments must have $epsilon$-crossed one another by $y'$. - The third invariant guarantees that there's an event before this happens, so by the contra-positive until an event happens the ordering + The crossing invariant guarantees that there's an event before this happens, so by the contra-positive until an event happens the ordering constraint is maintained. + The crossing invariant is maintained because the set of things to check (i.e. the set of line segments that $epsilon$-cross one another after $y$) only shrinks as $y$ increases. @@ -383,8 +383,8 @@ of the other one. We'll skip the proof of the following lemma, because it's basically the same as the last one. #lemma[ -Suppose that $(alpha^1, ..., alpha^i)$ satisfy the ordering invariant -at $y$, and suppose also that $(alpha^1, ..., alpha^(i+1))$ +Suppose that $(alpha^1, ..., alpha^(i+1))$ satisfy the ordering invariant +at $y$, and suppose also that $(alpha^1, ..., alpha^i)$ satisfy the crossing invariant at $y$. After running an intersection scan to the left, $(alpha^1, ..., alpha^(i+1))$ satisfy a slightly stronger crossing invariant at $y$: for every $j <= i$,