← Back to Pull requests

perf(dwio): Use SVE word gathers for narrow selected integers #139

Closed
unknown closed this pull request without merging on Nov 23, 2026 09:47 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 07:08 UTC
Author

The existing SVE selected-row decoder computes 64-bit bit positions and gathers a 64-bit word for every row. On little-endian AArch64 a field up to 25 bits plus its intra-byte shift fits in a 32-bit word. Use word gather lanes for complete vectors of eligible rows and widen only when writing 64-bit outputs. Vera's 128-bit SVE implementation can process four rows per gather.

An unsigned lane comparison checks every selected row before using 32-bit arithmetic. A conservative row bound avoids multiplication overflow and supports unordered or repeated selections. The remaining rows use the existing 64-bit loop whenever the offset or mask needs it.

Incremental full-suite results on Vera

| Suite | Reference mean | Candidate mean | Elapsed-time reduction | Pair 1 / Pair 2 |
|---|---:|---:|---:|---|
| NDS | 117.920 s | 117.965 s | -0.04% | -0.69% / +0.61% |
| NDS-H | 63.043 s | 61.855 s | +1.88% | +2.77% / +0.99% |

Each arm contains the same eight-PR stack and used GCC 15.2 PGO, 42 executors with eight slots, the same jemalloc configuration and the same SF1000 input. The change to the trained native package is confined to the BitPackDecoder translation unit. The SQL results matched for all 508 executions. NDS-H completed faster in both pairs. NDS changed direction between pairs. The previous gather loops account for 0.35% and 0.49% of original NDS and NDS-H executor cycles, respectively. These samples and two pairs provide limited attribution of the NDS-H wall-time change to this kernel. This PR is a draft.

On narrow random/strided selections, the median isolated time reductions were 49.97% with 32-bit output and 46.01% with 64-bit output.

Verification

  • All five ArmSelectedUnpack tests passed on Vera with this head, including a large interior row, arbitrary selection order, wide mask and guard-page coverage.

  • An additional differential harness passed 168 cases spanning large bit positions, both output types and wider masks.

  • Recompiling the reviewed header with the benchmark PGO data produced identical contents in all 30 ELF allocatable and code/constant relocation sections of the timed object.
  • Combined candidate against the unchanged development branch

    | Suite | Reference mean | Candidate mean | Elapsed-time reduction | Pair 1 / Pair 2 |
    |---|---:|---:|---:|---|
    | NDS | 122.055 s | 118.040 s | +3.29% | +3.52% / +3.06% |
    | NDS-H | 63.799 s | 61.976 s | +2.86% | +5.16% / +0.53% |

    This second series adds 508 reference-verified executions. The development comparison includes the preceding eight PRs. Full evidence and query breakdown

    Instruction-address profiling in the full suites found 19.04% fewer sampled cycles in the selected gather loops on NDS and 25.36% fewer on NDS-H, including the fallback in the new build. The loops originally represented 0.35% and 0.49% of all executor cycles. One complete capture per build and suite supports this profile comparison. Full hotspot table and cycle counts

    Diff: 451 lines (+338 / -113) across 5 files Reviewer: thirtiseven Review duration: 4479m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 451 lines diff across 5 files
    0.45
    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.366
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #139"
    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: 45.4% (MEDIUM) · Higher = larger blast radius
    45.4%
    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: 17.9% · Safe to merge
    17.9%