Skip to content

docs(cv): PurgedTail's cutoff is the f64 formula, compared exactly - #167

Merged
brndnmtthws merged 1 commit into
mainfrom
fix/purged-tail-f64-cutoff
Oct 20, 2026
Merged

brndnmtthws merged 1 commit into
mainfrom
fix/purged-tail-f64-cutoff

Conversation

@brndnmtthws

Copy link
Copy Markdown
Owner

Summary

Follow-up to #165. PurgedTail::split computes the cutoff offset (1 − fraction) · (last − first) in f64, 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] with t = 2^54 and fraction 0.5 cuts at t, as the f64 formula does).

Evaluating in f64 is deliberate: it gives what a decimal fraction means. Computing the cutoff exactly from the binary value of fraction would move ordinary splits. 0.3 of a 10-tick span cuts at 7 in f64, but the exact complement of binary 0.3 is a little over 7 and would cut at 8. The new test purged_tail_cuts_at_the_f64_cutoff pins 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, the purged_tail unit tests, pytest -k "purged or cross_validat", ruff check and format.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T17:27:06.321596Z fea1ced PR opened
🔒 Security Review ✅ Completed 2026-10-20T17:27:36.532107Z fea1ced PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@brndnmtthws
brndnmtthws merged commit e6218bb into main Oct 20, 2026
38 checks passed
@brndnmtthws
brndnmtthws deleted the fix/purged-tail-f64-cutoff branch October 20, 2026 17:47
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.

1 participant