[GLUTEN-12377][VL][DO NOT MERGE] Run the Delta suite with Velox operator output validation - #12783
Conversation
73b0530 to
cc8bc2f
Compare
CI statusThe 3
All decimal casting / type widening; nothing to do with deletion vectors. This PR only touches Did the diagnostic fire?Not this run — no |
a477eea to
9ff7063
Compare
80cde40 to
27f1a4d
Compare
27f1a4d to
2a5ed46
Compare
2a5ed46 to
500034b
Compare
apache#12783 turns on Velox's per-operator output validation for the Delta suite and is expected to fail, deterministically, at the scan that emits a row-index child shorter than the vector containing it (GLUTEN-12377). This branch is that change plus one line: it points UPSTREAM_VELOX_PR_ID at the upstream fix, so get-velox.sh applies it before the native build. The same suite is expected to pass here. Red on apache#12783 and green here is the before/after evidence that the defect is the Velox one and that the fix addresses it, without waiting for the fix to merge and a Velox bump to land. Velox issue: facebookincubator/velox#18535 Velox fix: facebookincubator/velox#18536 Not for merge: it pins the build to an unmerged pull request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Result -- both branches share a base commit and pinned Velox, differing only by whether facebookincubator/velox#18536 is applied:
Plan from here: once velox#18536 merges it arrives through the regular weekly Velox bump, after which a separate PR removes the DV bitmap entries from |
2fe44e7 to
7603b18
Compare
…idation The DV bitmap row-index failures in apache#12377 are intermittent and report a meaningless value, because by the time anything notices, the damage is an out-of-bounds read: a Delta deletion-vector write scans only synthesized columns with a pushed-down filter, and on that path Velox emits a RowVector whose row-index child has no rows. The child is then wrapped in a dictionary, and reading it returns whatever heap memory follows. Whether that memory happens to fall outside Delta's valid range decides whether the query aborts or silently accepts a wrong row index, which is why the failure moved from test to test and why the reported value differed every time. Velox can catch this at the source. `debug.validate_output_from_operators` checks every operator's output for structural consistency -- among other things, that a dictionary's indexes address rows its base vector has -- and names the first operator to emit a malformed vector. Expose it as a Gluten config and turn it on for the Delta suite. The suite is expected to fail while this is enabled, deterministically and with the responsible operator named, instead of intermittently with an arbitrary number: Output validation failed for [operator: TableScan, plan node ID: 0]: Child vector has size 0 less than parent and parent has no nulls 10. That is the point: it turns apache#12377 into a reliable signal. Once the upstream fix is picked up the suite must go green again, which is what validates it. Velox issue: facebookincubator/velox#18535 Velox fix: facebookincubator/velox#18536 Verified locally against the pinned Velox with and without that fix, on MergeIntoExtendedSyntaxSQLPathBasedDVsPredPushOnSuite "extended syntax - only update - isPartitioned: true": 9 validation failures and a failed test before, 0 failures and a pass after. The config defaults to off, so nothing outside this suite changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> [GLUTEN-12377][VL] Apply clang-format to the new config declaration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7603b18 to
8a0e2cf
Compare
apache#12783 turns on Velox's per-operator output validation for the Delta suite and is expected to fail, deterministically, at the scan that emits a row-index child shorter than the vector containing it (GLUTEN-12377). This branch is that change plus one line: it points UPSTREAM_VELOX_PR_ID at the upstream fix, so get-velox.sh applies it before the native build. The same suite is expected to pass here. Red on apache#12783 and green here is the before/after evidence that the defect is the Velox one and that the fix addresses it, without waiting for the fix to merge and a Velox bump to land. Velox issue: facebookincubator/velox#18535 Velox fix: facebookincubator/velox#18536 Not for merge: it pins the build to an unmerged pull request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
apache#12783 turns on Velox's per-operator output validation for the Delta suite and is expected to fail, deterministically, at the scan that emits a row-index child shorter than the vector containing it (GLUTEN-12377). This branch is that change plus one line: it points UPSTREAM_VELOX_PR_ID at the upstream fix, so get-velox.sh applies it before the native build. The same suite is expected to pass here. Red on apache#12783 and green here is the before/after evidence that the defect is the Velox one and that the fix addresses it, without waiting for the fix to merge and a Velox bump to land. Velox issue: facebookincubator/velox#18535 Velox fix: facebookincubator/velox#18536 Not for merge: it pins the build to an unmerged pull request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
What this does
Exposes Velox's
debug.validate_output_from_operatorsas a Gluten config and turns it on for the Delta Spark UT.Why
The DV bitmap row-index failures in #12377 are intermittent and report a meaningless value. The reason is that by the time anything notices, the damage is an out-of-bounds read: a Delta deletion-vector write scans only synthesized columns with a pushed-down filter, and on that path Velox emits a
RowVectorwhose row-index child has no rows. That empty child is then wrapped in a dictionary, and reading it returns whatever heap memory follows. Whether that memory happens to land outside Delta's valid range decides whether the query aborts or silently accepts a wrong row index — which is why the failure moved from test to test and the reported value differed every time (9223372036854775807,-1,0xe43315c000007f00, ...).Velox can catch this at the source instead. The validation checks every operator's output for structural consistency — among other things, that a dictionary's indexes address rows its base vector actually has — and names the first operator to emit a malformed vector.
Companion PR
#12808 is this change plus one line pointing
UPSTREAM_VELOX_PR_IDat the upstream fix, branched from the same commit onmain. It is expected to be green. Red here and green there is the before/after evidence.Expected result
This PR is expected to make the Delta suite fail, and that is the point. It should fail deterministically, naming the responsible operator:
instead of intermittently with an arbitrary row index.
Once the upstream fix is picked up — via a Velox bump, or
UPSTREAM_VELOX_PR_IDinep/build-velox/src/get-velox.sh— the suite must go green again, which is what validates the fix.Verification
This repo pins
VELOX_BRANCH=dft-2026_08_17, in which the defect is confirmed still present:SelectiveStructColumnReaderBase::next()still passesoutputRows()tosetRowNumberField(), anduseOutputRows()is stillscanSpec_->hasFilter() || hasDeletion(). The fix from velox#18536 also applies cleanly to that revision, which is what #12808 relies on.The evidence is this PR against #12808, which is identical to it except for one line that applies velox#18536 — same base commit, same pinned Velox, so the fix is the only variable.
From the first pair of runs:
Output validation failedBoth of #12808's two failing shards reported
Regressions (new failures): 0and failed only becauseFAIL_ON_FIXED=trueand twoImplicitStreamingMergeCastingSuitebaseline entries now pass — unrelated to this change, caused by the cast-mode fix in #12051. Both PRs now carry the cherry-pick that removes those stale entries, and a fresh pair of runs is in flight.So with the Velox fix applied, every failure attributable to this defect disappears across the whole Delta suite, and no unrelated invariant violations surface — which also answers whether enabling validation suite-wide is safe.
Separately, the same suite with deletion vectors but predicate pushdown off (
...DVsPredPushOffSuite) shows no violation at all, consistent with the upstream analysis: the defect needs a filter on the scan.How do we know this is the same defect as #12377, and not a different one?
The error text differs — validation reports
Child vector has size 0 less than parent, while #12377 reports a bad row index — so it is worth stating why they are the same defect:Delta bitmap row index cannot be negative: -5163232936757035008carriedencoding=DICTIONARY size=1 baseSize=0 valuesBytes=0 baseIndex=0: the aggregator was reading a dictionary indexing into an empty base. Same column, sameTableScan[0]->PartialAggregation[9]plan.flaky-error-patterns.txtquarantines the original error, so "0 regressions" alone would not settle this. In [DO NOT MERGE] Same as #12783, plus the upstream Velox fix (expected green) #12808's run the sampled shards reportQuarantined flaky failures (ignored) | 0together with zero occurrences of the original bitmap error — it did not happen, rather than happening and being hidden.Scope
The config defaults to off, so nothing outside the Delta suite changes.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot CLI (Claude Opus 5)