← Back to Pull requests

removing hard coded version #797

Closed
unknown closed this pull request without merging on Nov 11, 2026 22:02 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 19:30 UTC
Author

Write feature headers at the graph's version, not CURRENT_VERSION

Problem

Feature headers that embed a compressor always serialize it at OnDiskGraphIndex.CURRENT_VERSION, whatever version the graph itself is written at:

| feature | call |
|---|---|
| FusedPQ.writeHeader | pq.write(out, CURRENT_VERSION) |
| NVQ.writeHeader | nvq.write(out, CURRENT_VERSION) |
| SeparatedNVQ.writeHeader | nvq.write(out, CURRENT_VERSION) |
| FusedASH.writeHeader | ash.write(out, CURRENT_VERSION) |

The format classes know their own version, but Feature.writeHeader(IndexWriter) gives them no way to pass it on. This dates from the GraphIndexFormat hierarchy, not from ASH. While CURRENT_VERSION was 6 it went unnoticed. Now that ash-dev raises it to 7, a graph written at V6 (for example through withVersion(6) to stay rollback-safe) embeds version 7 in its PQ and NVQ headers. So it isn't byte-identical to what 4.0.x writes, contrary to the claim that versions 6 and below are unchanged. FusedASH repeats the pattern, so it would show the same bug as soon as CURRENT_VERSION moves past 7.

Change

  • Feature: adds default void writeHeader(IndexWriter out, int version). The default calls the existing method, so other Feature implementations still compile and behave as before. writeHeader(IndexWriter) is deprecated, since a header inside a graph has to be written at the graph's version.

  • FusedPQ, NVQ, SeparatedNVQ, FusedASH: implement the versioned method and serialize their compressor at that version. Their deprecated writeHeader(out) calls it with CURRENT_VERSION, so direct callers get the same bytes as before.

  • InlineVectors, SeparatedVectors: their headers don't depend on the version. They get the same structure so all built-in features look alike.

  • AbstractGraphIndexFormat.writeHeaderFeatures (V2–V5) and GraphIndexFormatV6.writeHeaderFeatures (V6, V7): pass getVersion().
  • headerSize() is unchanged. The compressors' serialized size doesn't depend on the version for any format that supports the feature.

    Diff: 263 lines (+197 / -66) across 3 files Reviewer: tlwillke Review duration: 152m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 263 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #797"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.3% (MEDIUM) · Higher = larger blast radius
    39.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.5% · Safe to merge
    15.5%