Repository navigation
docs(cv): PurgedTail's cutoff is the f64 formula, compared exactly - #167
Merged
Merged
Conversation
PurgedTail::split evaluates the cutoff offset (1 - fraction) * span in f64, rounds it up to a whole tick, and compares every decision time's integer offset with it exactly. The docs (Rust and Python) now say so, including that the span itself rounds past 2^53 ticks. The f64 evaluation is deliberate: it is what a decimal fraction means. 0.3 of a 10-tick span cuts at 7, while the exact complement of binary 0.3 (a little over 7) would cut at 8; the new test pins it.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Follow-up to #165.
PurgedTail::splitcomputes the cutoff offset(1 − fraction) · (last − first)inf64, rounds it up to a whole tick, and compares every decision time's integer offset against it exactly. The Rust and Python docs only gave the real-number formula. They now say how it is evaluated, including that past 2^53 ticks the span itself rounds (e.g.[0, t, t+1, 2t+1]witht = 2^54and fraction 0.5 cuts att, as thef64formula does).Evaluating in
f64is deliberate: it gives what a decimal fraction means. Computing the cutoff exactly from the binary value offractionwould move ordinary splits. 0.3 of a 10-tick span cuts at 7 inf64, but the exact complement of binary 0.3 is a little over 7 and would cut at 8. The new testpurged_tail_cuts_at_the_f64_cutoffpins the decimal case next to the existing exact-offset and tiny-fraction cases.No behavior change.
Checks
cargo fmt --check, clippy--all-targets --features wgpu -D warnings,RUSTDOCFLAGS=-D warnings cargo doc --features wgpu, thepurged_tailunit tests,pytest -k "purged or cross_validat", ruff check and format.