Repository navigation
sampler: measure relative-weight cutoffs and record the negative CPU result - #65
Merged
midagedev merged 1 commit intoOct 12, 2026
Conversation
Owner
|
Thank you. The 0.3.1 release is being cut now, so I will review this after the tag today. |
6 of 7 tasks
Owner
|
Thanks. The result is clear: We will finish it on our side and merge it. You do not need to change anything:
One thing only you have: the raw |
midagedev
added a commit
that referenced
this pull request
Oct 12, 2026
… filter values threshold.rs's mod tests ran under no gate-* or lab-* recipe; the timed --check-only rows are the example's check. The note's table gives the filter values (T0.8 k40 p0.95 m0.05, sample_bench.rs:100) and marks the cost sentence [derived]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6 of 7 tasks
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.
What and why
Add a relative-weight cutoff arm to
sample_bench, comparing its candidates and same-seed tokens withSampler::sampleoutside each timer. The CPU experiment does not meet the 300 us saving criterion: all 16 ordinary cells match candidates and tokens, but paired median sampling time is 414.1–1899.7 us slower. Explicit top-k ties, top-p ties and rounded min-p boundaries also fail semantic equivalence, so this implementation stays out of the engine.Closes #34 as a recorded negative experiment, subject to maintainer review.
The cutoff preserves Bloomery's pre-temperature filtering and pre-min-p top-p normalizer. Byte-radix count/mass boundaries feed a single scalar floor. The existing benchmark chain owns the CDF draw, avoiding a second full filtering/sorting pass.
--check-onlyexposes semantic boundaries;--threshold-onlymeasures the new pair; the original invocation retains its existing tables and adds the new comparison.Full implementation details, all 16 rows, conditions and limitations are in
docs/contrib/sampler-threshold.md.Code shape
INVALID; there is no production fallback hiding them.cargo fmtandcargo clippyare clean on the touched sampler targets.Duplication: private Xoshiro draw sequence mirrored in the isolated benchmark, as explained above.
What I ran
cargo test -p bloomery-sampler: all 11 sampler tests pass.cargo test -p bloomery-sampler --example sample_bench: 3 tests pass, including singleton/RNG scheduling and the scalar tie counterexample.cargo clippy -p bloomery-sampler --all-targets -- -D warnings: passes.DONE tier=t0 total=9 red=0 wall=16s(fmt, arch, comments, levers, loads, ptx-names, rustflags, unsafe, waits).The lease runner returns 0 after 32 seconds. Each cell rotates 4 synthetic rows, warms 100 pairs, and records 1000 pairs with alternating arm order. The 16 cells use V=151936/154880, peaked/flat rows and defaults/top-k/top-p+min-p/min-p filters. All report
candidate_bad=0 token_bad=0 BELOW_300US. The three explicit boundary counterexamples printfalse falseand remain disqualifying despite the ordinary rows matching.No engine port is proposed. This result prices this radix implementation on this CPU and does not establish a GPU or end-to-end decode result. Full T0/T1/workstation gate validation remains with the maintainer.
Hardware
Linux 7.0.0-38-generic x86_64, Intel Core i5-12600K, approximately 64 GB RAM, logical CPU 0; nightly-2026-08-28 with
RUSTFLAGS=-C target-cpu=native. The base isb8d1ff06e29819c857948ecd68a450b5226d80fe. Both arms share one release binary and local CPU lease. Ordinary serving processes remained present and are recorded by the pre/post witness.