Skip to content

fix: guard ALP zero-length exponent search, harden Fsst record and fitness-test regex - #316

Merged
dfa1 merged 1 commit into
mainfrom
fix/alp-zero-length-fsst-hardening
Jul 26, 2026
Merged

fix: guard ALP zero-length exponent search, harden Fsst record and fitness-test regex#316
dfa1 merged 1 commit into
mainfrom
fix/alp-zero-length-fsst-hardening

Conversation

@dfa1

@dfa1 dfa1 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • AlpEncodingEncoder.findExponentsF64/findExponentsF32 divided by zero when handed a zero-length array — a real case on the Raincloud corpus: SparseEncodingEncoder's cascade can strip every all-zero-bit value from an F64/F32 chunk (e.g. a congestion_surcharge column that's 0.0 for a whole chunk). AlpRdEncodingEncoder already guarded this; this mirrors it in the plain-ALP encoder.
  • Fsst record (FsstEncodingEncoder) gains content-based equals/hashCode/toString for its array fields, resolving a SonarCloud RELIABILITY finding (java:S6218).
  • EncodingTableFitnessTest's TABLE_ROW regex uses possessive quantifiers to remove super-linear backtracking risk (java:S8786), with no change to matched input.

Test plan

  • ./mvnw verify -DskipTests (full reactor compile)
  • ./mvnw -pl writer,integration -am test -Dtest="AlpEncodingEncoderTest,EncodingTableFitnessTest,FsstEncodingEncoderTest"
  • Workflow-backed code review (high effort) — one finding raised (Fsst equals/hashCode inconsistent with the codebase's @SuppressWarnings("java:S6218") convention elsewhere); kept as-is since the point here is resolving the underlying Sonar finding, not just silencing the annotation

🤖 Generated with Claude Code

…tness-test regex

- AlpEncodingEncoder.findExponentsF64/F32 divided by zero when handed a
  zero-length array (a real case on the Raincloud corpus: SparseEncodingEncoder's
  cascade can strip every all-zero-bit value from an F64/F32 chunk, e.g. a
  congestion_surcharge column that is 0.0 for a whole chunk). AlpRdEncodingEncoder
  already guarded this; mirror it here.
- Fsst record (FsstEncodingEncoder) gains content-based equals/hashCode/toString
  for its array fields, fixing a SonarCloud RELIABILITY finding (java:S6218).
- EncodingTableFitnessTest's TABLE_ROW regex uses possessive quantifiers to
  remove super-linear backtracking risk (java:S8786), with no change to matched
  input.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 872b055 into main Jul 26, 2026
6 checks passed
@dfa1
dfa1 deleted the fix/alp-zero-length-fsst-hardening branch July 26, 2026 12:18
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