Skip to content

fix(spectrum): unbreak main — pass l_pac to validate_packed_pac in stepper/lockstep paths - #59

Merged
nh13 merged 2 commits into
mainfrom
fix/spectrum-stepper-validate-pac-arity
Jun 23, 2026
Merged

fix(spectrum): unbreak main — pass l_pac to validate_packed_pac in stepper/lockstep paths#59
nh13 merged 2 commits into
mainfrom
fix/spectrum-stepper-validate-pac-arity

Conversation

@nh13

@nh13 nh13 commented Jun 23, 2026

Copy link
Copy Markdown

main does not currently compile: its CI has been red since #50 (cross-query lockstep primitives) landed. #50 added four new packed-pac entry points — forward_spectrum_via_stepper, forward_spectrum_lockstep, mem_search_via_stepper, mem_search_lockstep — each calling validate_packed_pac(pac, num_bases, ctx) with the old 3-argument signature. In parallel, #47 (word-at-a-time decode) had already changed validate_packed_pac to 4 arguments (pac, num_bases, l_pac, ctx) so the packed length is validated against the index l_pac. The two PRs were merged without recompiling against each other, so cargo build/cargo test fail on main with four E0061: this function takes 4 arguments but 3 arguments were supplied errors.

This passes self.l_pac() as the third argument at all four sites, exactly as the serial forward_spectrum/mem_search callers already do, restoring the num_bases == l_pac check for those paths.

Commits:

  • fix(spectrum): … — the four arity corrections (functional; this is what unbreaks the build).
  • style(spectrum): … — a rustfmt wrap of an unrelated multi-arg call in keyed_tests that the current nightly rustfmt (used by the CI fmt step) reformats; separated from the functional commit.

Verified locally: cargo build --all-targets, cargo clippy -p prmi -p prmi-sys --all-targets --all-features -- -D warnings, cargo test --workspace, and cargo +nightly fmt --all -- --check all pass. This also unblocks #53 (and every other open PR), whose merge-with-main CI is currently red for the same reason.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation robustness in spectrum and memory search operations by ensuring consistent validation parameters are applied across all search entry points.

nh13 added 2 commits June 23, 2026 11:34
…paths

The cross-query stepper and lockstep entry points (forward_spectrum_via_stepper,
forward_spectrum_lockstep, mem_search_via_stepper, mem_search_lockstep) called
validate_packed_pac with the pre-l_pac 3-argument signature, so the crate failed
to compile against the current 4-argument signature (pac, num_bases, l_pac, ctx).
Pass self.l_pac() as the serial spectrum/mem_search callers already do, so the
packed-pac length check validates num_bases against the index l_pac.
The current nightly rustfmt wraps the multi-argument call in the keyed_tests
.kmt-fallback test; apply it so the CI fmt check passes. Formatting only.
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fc516f8f-7b5c-41d5-a3d3-efd2be931cc0

📥 Commits

Reviewing files that changed from the base of the PR and between 7367f73 and d83d5a4.

📒 Files selected for processing (1)
  • prmi/src/index/spectrum.rs

Walkthrough

Four validate_packed_pac call sites in spectrum.rs — covering forward_spectrum_via_stepper, forward_spectrum_lockstep, mem_search_via_stepper, and mem_search_lockstep — are updated to pass self.l_pac() as the expected packed base count. A test helper call is reformatted across multiple lines with no logic change.

Changes

Packed-PAC Validation Fix

Layer / File(s) Summary
Pass l_pac to validate_packed_pac at all four entry points
prmi/src/index/spectrum.rs
forward_spectrum_via_stepper, forward_spectrum_lockstep, mem_search_via_stepper, and mem_search_lockstep now supply self.l_pac() to validate_packed_pac; test helper call reformatted with no logic change.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • fg-labs/prmi#47: Directly related — both PRs harden validate_packed_pac calls in spectrum.rs to guard against num_bases != l_pac mismatches.
  • fg-labs/prmi#50: Touches the same lockstep packed-pac validation paths in spectrum.rs that this PR fixes.
  • fg-labs/prmi#28: Adds mem_search_capped with its own packed-pac sizing/validation, sharing the same validation layer patched here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: adding the missing l_pac argument to validate_packed_pac calls in stepper/lockstep code paths to resolve compilation errors.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/spectrum-stepper-validate-pac-arity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nh13

nh13 commented Jun 23, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13
nh13 merged commit 4cc06b9 into main Jun 23, 2026
4 checks passed
@nh13
nh13 deleted the fix/spectrum-stepper-validate-pac-arity branch June 23, 2026 19:53
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