fix(scaling): bound LSR ranking input materialization - #614
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@opencode-agent address Take a bounded writer lease only if a final refetch still shows Draft head Run Implement the plan in
Prefer standard-library fixed-width unsigned storage plus zero-copy/bounded NumPy conversion; include all live fixed-width arrays in the budget and document what the ceiling does not claim. Add only meaningful missing edge/coverage tests in the existing authoritative test file, reach 100% changed production statement/branch coverage and complete public docstrings, add bounded doctoring/changelog fragment, render/check |
|
@opencode-agent address Previous handoff is stale because protected Preserve the existing RED-first scope in |
|
@opencode-agent address Fresh handoff after protected The intended RED is now exact machine evidence from CI run Implement only the bounded GREEN specified by |
|
@opencode-agent address Reacquire a bounded source-writer lease only if a final refetch still shows Draft head The intended RED is already proven on exact source head in CI run Implement only
Do not change Rust LSR/I-LSR formulas, public signatures/results, dependencies/workflows/version/release, canonical architecture PR #604, or unrelated scaling APIs. Stop after exact-head deterministic GREEN evidence so normal CI/security/review can run. |
|
@opencode-agent address Take a bounded writer lease only if a final refetch still shows Draft head Fresh exact RED is already established on CI run First reconcile protected main non-destructively because #590 changed only independent
Add only the bounded doctoring/changelog fragment required by this reliability contract, render/check CHANGELOG, run focused tests plus relevant scaling tests, changed-production statement/branch coverage, docstring checks and |
|
@opencode-agent address Reacquire this bounded writer lease only if a final refetch still shows Draft head Fresh CI proves the intended production-boundary RED at this head: exactly six failures in First reconcile current protected main non-destructively; do not discard #590 or widen the two-wrapper Add only necessary doctoring/changelog material, render/check |
|
@opencode-agent address Take a bounded writer lease only if a final refetch still shows Draft head The branch has already been reconciled non-destructively with current protected main and now carries only the fail-first test plus its implementation plan. Fresh predecessor CI Implement the minimum GREEN only in
Run Keep Draft. Do not alter Rust formulas, public LSR/I-LSR result semantics, dependencies/workflows/credentials/version/release, canonical architecture PR #604, mark Ready, approve, merge, or widen into adjacent input classes. Stop after exact-head deterministic evidence. |
|
@opencode-agent address Take a bounded writer lease on PR #614 only if a final refetch still shows exact Draft head Fresh exact-head CI proves the intended production RED is still live and isolated: 6 failures in Implement the minimum GREEN in
Then run |
|
Superseded bookkeeping note: an earlier exact-current writer handoff already covers head |
|
@opencode-agent address Take a bounded source-writer lease only if a final refetch still shows Draft head Exact-current CI already establishes the intended production-boundary RED: Security Scan and SAST are green; Rust, package/reinstall/release-acceptance, GPU and fuzz jobs are green; Python has exactly six failures in
Run the focused tests to GREEN, add only meaningful branch/statement coverage needed for 100% changed production coverage, update the bounded resource/security doctoring and authoritative changelog fragment if the implementation contract changes, render/check managed |
|
@opencode-agent address Take the bounded source-writer lease only if a final refetch still shows Draft head The intended production-boundary RED remains the six previously proven behaviors in Implement the minimum GREEN only in the shared |
|
@jules address Fallback bounded source-writer handoff for exact Draft head The intended RED is already exact and deterministic: Run focused RED→GREEN, meaningful 100% changed production statement/branch coverage and complete public docs, authoritative changelog render/check if a fragment is added/changed, formatting/lint and |
|
@opencode-agent address Superseding bounded RED→GREEN handoff after protected-main movement. Fresh identities immediately before dispatch: Draft #614 exact head First reconcile current protected main non-destructively, preserving accepted #630 CodeQL analyze pin and the committed RED plan/tests. Re-run Keep Draft. Do not alter Rust LSR formulas, public result semantics, dependencies/workflows/version/release, canonical docs #604, Ready/approval/merge state, or widen to |
|
@opencode-agent address Superseding LSR bounded-materialization handoff after #631 merged. Fresh identities: Draft #614 head First reconcile protected main non-destructively, preserving both CodeQL 4.37.6 pins and the fail-first plan/tests. Run Keep Draft. No Rust formula/public-result/dependency/workflow/version/release/canonical-docs #604/Ready/approval/merge changes and no |
|
@jules address Fallback sole branch writer for exact Draft #614 head First reconcile the two accepted CodeQL 4.37.6 protected-main commits non-destructively. Preserve the intentional RED history and run Keep Draft and stop source writes after one coherent verified update. Do not touch |
|
Superseded by clean-lineage Draft #692. Fresh comparison against protected |
Buyer-visible reliability gap
The public LSR/I-LSR ranking wrappers validate item values and cap the dense chain at
n <= 10_000, but the current branch still materializes each caller-controlled ranking withlist(ranking)and consumes the outer rankings iterable without a total-entry bound. Infinite/adversarial iterables can therefore run indefinitely or leak caller-controlled exception text before package validation; very large finite streams can grow Python/NumPy CSR storage until memory pressure even though the Rust numerical kernel is bounded byn.This Draft advances #612 with a fail-first resource/security contract.
Intentional RED contract
tests/test_scaling_ranking_input_bounds.pyrequires:n + 1requests from one inner ranking before rejecting impossible overlength;ValueErrornormalization for ordinary outer/inner iterable failures;KeyboardInterrupt,SystemExitandGeneratorExit;list(ranking)while preserving one shared_rankings_to_csrboundary for LSR and I-LSR.Finite probes deliberately raise if the implementation asks for an unbounded next value, so the RED is fast and deterministic rather than hanging CI.
Exact-current evidence
Freshly revalidated for this update:
main:8db4bf358b0a469915d6c5e336054f4a4f9c6b46with PR 🧪 Add tests for Luce Spectral Ranking (LSR) #590 already integrated;cd3443801090249eafc9e60a4ca9fb57133dc789;tests/test_scaling_ranking_input_bounds.pyafter the rest of the suite passes;list(ranking), unbounded outer consumption, missing CSR-byte enforcement at the 31-byte boundary, unredacted ordinary outer iteration failure, unredacted ordinary inner iteration failure, and the source-level ban onlist(ranking);The top-level GitHub PR
base_shafield can reflect the historical base at PR creation; live integration decisions must use the exact protected-main tip above and a freshcompare_commits, not that stale metadata field.Planned minimum GREEN
MAX_RANKING_CSR_BYTESceiling;n + 1requests per inner ranking;list(ranking)or equivalent full materialization;np.uint64transport and byte/numerical identity for accepted list/tuple/generator inputs through the unchanged Rust LSR/I-LSR kernels; andNumerical and scope boundary
All LSR/I-LSR transition-rate, stationary-distribution, smoothing, convergence, parameter-centering and worth-normalization arithmetic remains Rust-owned and unchanged.
_top1_to_csris a separate adjacent follow-up after this shared rankings boundary is accepted; do not silently widen this PR. No provider, database, workflow, dependency, scoring decision, validity claim, version bump, canonical #604 architecture rewrite, or release belongs here.Remaining Draft gate
Keep Draft until current protected main is reconciled non-destructively, the intended RED reaches focused GREEN, the changed production boundary has 100% statement/branch coverage and complete public docs, authoritative changelog material is rendered/checked, and one unchanged exact head passes full Python, Rust/PyO3, package/reinstall/release acceptance, explicit GPU-no-skip, fuzz, Security Scan, SAST, current-head automated review, zero valid unresolved findings, and repository approval/branch-protection policy.
Advances #612.