mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #61] [CLOSED] text sampler: an empty penalty window must not touch the unsized shared bitmap #2434
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2434
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/61
Author: @j-luwierski
Created: 9/28/2026
Status: ❌ Closed
Base:
main← Head:fix/penalty-bitmap-empty-window📝 Commits (1)
1010075sampler: an empty penalty window must not touch the unsized shared bitmap📊 Changes
2 files changed (+33 additions, -3 deletions)
View changed files
📝
src/kernels/cuda/sampler.cu(+7 -3)📝
src/kernels/sampler_parity.cpp(+26 -0)📄 Description
Follow-up from the #53 discussion (the penalties fix itself landed in v0.1.17 - this is the other thing I
mentioned there).
use_bitsrequired only a non-null history, but the launch sizes the shared bitmap forpenalty_last_n > 0alone. A caller handing
sample_tokensa history buffer with the penalties disabled (e.g. a stale bufferfrom a previous penalised request) makes the kernel zero
bits_wordswords of a zero-byte dynamic sharedallocation.
set_historypassesnullptrwhen the window is emptyThe gate now also requires a non-empty window (
hlen > 0, both kernels), and fixture 11 pins a stalehistory with
last_n = 0to the no-history result in both kernels.Verification
sampler_parity --selftest: 0 failures (fixtures 1-11)2000 cases, 0 mismatches
compute-sanitizer: racecheck 0 hazards, memcheck 0 errors🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.