Skip to content

feat(client): accept partial replay supports listed by the server - #210

Closed
hallerite wants to merge 1 commit into
feat/compact-sampler-drawsfrom
feat/partial-sampling-supports
Closed

hallerite wants to merge 1 commit into
feat/compact-sampler-drawsfrom
feat/partial-sampling-supports

Conversation

@hallerite

@hallerite hallerite commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Stacked on #202. Client side of PrimeIntellect-ai/prime-rl#4321.

prime-rl's inference server now caps how many ids each replayed token ships (inference.sampling_support_width). A support wider than that is returned partially: its top ids, the sampled token and its least likely id (the cutoff). Its probabilities stay normalized over the whole support, so they sum to less than one. The server lists those rows in compact_logprobs.partial_rows.

  • _parse_compact_logprobs validates partial_rows (a list of in-range row indices) and passes each row's flag to _select_sampler_head.
  • _select_sampler_head skips the "normalizes over the recorded support" check for partial rows only. Every other replay row keeps the strict check, and the <= 1.0001 mass bound still applies to all rows.

tests/test_client.py: malformed partial_rows payloads are rejected; a listed partial row with mass 0.9 is accepted; the same row without the listing still fails. 112 passed, 6 skipped locally.

🤖 Generated with Claude Code

Note

Support server-declared partial replay supports in client logprob parsing

  • _parse_compact_logprobs in renderers/client.py now reads the optional partial_rows field, validates it as a list of integer row indices, and passes per-row partial status to _select_sampler_head
  • _select_sampler_head gains a partial argument. Partial supports still need probabilities for all support ids, but skip the normalization check. The mass ceiling of 1.0001 still applies
  • Behavioral Change: rows not listed in partial_rows keep the full normalization requirement; malformed partial_rows values (strings, out-of-range indices, booleans) are rejected

Macroscope summarized e190f65.

A replayed support wider than the server's sampling_support_width returns
only part of its ids (top ids, the sampled token and the cutoff), with
probabilities still normalized over the whole support. The server lists
those rows in compact_logprobs.partial_rows; their recorded mass may fall
short of one. Every other support row keeps the strict normalization check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hallerite

Copy link
Copy Markdown
Member Author

Closing together with PrimeIntellect-ai/prime-rl#4321, which PrimeIntellect-ai/prime-rl#4233 makes unnecessary.

@hallerite hallerite closed this Oct 29, 2026
@hallerite
hallerite deleted the feat/partial-sampling-supports branch October 29, 2026 16:05
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