Skip to content

[query] make the locus interface representation-agnostic - #15878

Merged
hail-ci-robot merged 1 commit into
mainfrom
cv/query/stack2/slocus-repr-agnostic-api
Oct 26, 2026
Merged

hail-ci-robot merged 1 commit into
mainfrom
cv/query/stack2/slocus-repr-agnostic-api

Conversation

@chrisvittal

Copy link
Copy Markdown
Collaborator

SLocusValue no longer exposes the contig string's address (contigLong). Instead it provides contigIdx, the contig's index in the reference genome, and packed, the locus as (contig_index << 32) | position. The canonical locus computes both through the reference genome's contig-index lookup. SCanonicalLocusPointer's coercion, the only caller of contigLong, now matches on the canonical value directly.

contigType moves from PLocus to PCanonicalLocus, and locus prefix codes encode the packed integer instead of the global position. Prefix codes are unused, so the change is not observable.

Security Assessment

  • This change cannot impact the Hail Batch instance as deployed by Broad Institute in GCP

Stack created with GitHub Stacks CLI • Give Feedback 💬

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f953bf5-21a8-4fc7-b7cf-40e3062d556b
Commits

Reviewing files that changed from the base of the PR and between 280053f and 023711e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7044b3cf-c0f6-4cf5-98e1-888395d1189e
📥 Commits

Reviewing files that changed from the base of the PR and between 11d5378 and 76d3613.

📒 Files selected for processing: 5
  • hail/hail/src/is/hail/types/physical/PLocus.scala
  • hail/hail/src/is/hail/types/physical/stypes/concrete/SCanonicalLocusPointer.scala
  • hail/hail/src/is/hail/types/physical/stypes/concrete/SUnreachable.scala
  • hail/hail/src/is/hail/types/physical/stypes/interfaces/SLocus.scala
  • hail/hail/test/src/is/hail/types/physical/stypes/concrete/SCanonicalLocusPointerSuite.scala
💤 Files with no reviewable changes: 1
  • hail/hail/src/is/hail/types/physical/PLocus.scala

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Locus value implementations now provide a contig index and a packed value. Prefix codes encode the packed value. New property tests check these values against reference genomes and verify locus ordering.

Changes: Locus Encoding

Layer / File(s) Summary
Locus values and prefix codes
hail/hail/src/is/hail/types/physical/PLocus.scala, hail/hail/src/is/hail/types/physical/stypes/interfaces/SLocus.scala, hail/hail/src/is/hail/types/physical/stypes/concrete/SCanonicalLocusPointer.scala, hail/hail/src/is/hail/types/physical/stypes/concrete/SUnreachable.scala, hail/hail/test/src/is/hail/types/physical/stypes/concrete/SCanonicalLocusPointerSuite.scala
SLocusValue replaces contigLong with contigIdx and adds packed. Canonical locus values memoize the contig index and packed value. prefixCode encodes the packed value. Tests compare the values with reference genome representations and check locus ordering.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: ehigham

Merge Risk: Minimal · previous review 76d36

No confirmed issue prevents merging after normal build and test checks.

Security architecture risk: Low · up to 76d36

The inspected changes preserve copy ownership and include checks for locus ordering. No introduced security issue was identified. Risk remains limited but nonzero because encoded bytes change, and compatibility with external consumers has not been established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated affected scope is locus encoding within query evaluation, including callers of the existing prefixCode IR function. The available evidence does not establish cross-tenant, credential, infrastructure, or data-store authority changes; deployment exposure and external byte consumers remain unresolved.

Trust Boundaries and Controls

  • observed — The encoding path uses the reference genome attached to the locus value. Packing does not add explicit contig-membership or position validation. The former global-position path also relied on reference-genome lookup and did not explicitly validate position; no newly bypassed security control was established.
Pre-merge checks: Passed 4
Check name Status Explanation
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.
Title check Passed The title clearly summarizes the main change: making the locus interface representation-agnostic.
Description check Passed The description explains the interface changes, implementation impact, and security assessment. It omits the explicit Change Description heading and issue reference, but the required information is ot…
Full details: Description check

Explanation

The description explains the interface changes, implementation impact, and security assessment. It omits the explicit Change Description heading and issue reference, but the required information is otherwise present.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chrisvittal
chrisvittal added this pull request to stack #15876 October 16, 2026 23:28
@hail-ci-robot
hail-ci-robot force-pushed the cv/query/stack2/slocus-repr-agnostic-api branch 2 times, most recently from 1c1b7dd to 8df0751 Compare October 22, 2026 16:54
@chrisvittal
chrisvittal force-pushed the cv/query/stack2/slocus-repr-agnostic-api branch from 8df0751 to 49c62ee Compare October 22, 2026 17:19
@hail-ci-robot
hail-ci-robot force-pushed the cv/query/stack2/slocus-repr-agnostic-api branch 8 times, most recently from 48ce497 to e1fd6e4 Compare October 23, 2026 14:20
@chrisvittal
chrisvittal force-pushed the cv/query/stack2/slocus-repr-agnostic-api branch 2 times, most recently from 76e4afd to 280053f Compare October 26, 2026 14:30
Base automatically changed from cv/query/stack2/key-liftover+sequence-by-rg-value to main October 26, 2026 20:39
SLocusValue no longer exposes the contig string's address (contigLong).
Instead it provides contigIdx, the contig's index in the reference
genome, and packed, the locus as (contig_index << 32) | position. The
canonical locus computes both through the reference genome's
contig-index lookup. SCanonicalLocusPointer's coercion, the only caller
of contigLong, now matches on the canonical value directly.

contigType moves from PLocus to PCanonicalLocus, and locus prefix codes
encode the packed integer instead of the global position. Prefix codes
are unused, so the change is not observable.
@hail-ci-robot
hail-ci-robot force-pushed the cv/query/stack2/slocus-repr-agnostic-api branch from 280053f to 023711e Compare October 26, 2026 20:39
@hail-ci-robot
hail-ci-robot merged commit d887b28 into main Oct 26, 2026
13 checks passed
@hail-ci-robot
hail-ci-robot deleted the cv/query/stack2/slocus-repr-agnostic-api branch October 26, 2026 21:13
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.

4 participants