feat(write): index-aware max_mem accounting#163
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…minates Compute effective_max_mem by subtracting the variant reader's resident index size (variants.nbytes) from the user-supplied max_mem budget, then pass effective_max_mem to the VCF/PGEN chunking helpers. Emit a UserWarning when the index exceeds 50% of max_mem so users know to increase the budget. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
variants.nbytes(new in genoray 2.4.0) frommax_membefore passing the remainder to genoray chunking in_write_from_vcf/_write_from_pgen. Makesmax_mema true total cap rather than a budget that excludes the already-resident variant index (CHROM/POS/REF/ALT/ILEN), which for large cohorts can be GBs.UserWarningwhen the resident genoray index exceeds 50% ofmax_mem, so users know to increase the budget.genoraydependency to>=2.4.0(the release introducing.nbytes).gvl.writedocstring to document the new accounting.See `docs/superpowers/specs/2026-05-19-max-mem-index-aware-design.md` for the design and `docs/superpowers/plans/2026-05-19-max-mem-index-aware.md` for the implementation plan.
Test plan
🤖 Generated with Claude Code