fix(layout): restore column detection on table pages and sparse pages - #430
Merged
Merged
Conversation
The page_has_table guard predates item claiming: by grouping time the detected table's items have already left the flow, so a table cannot fake a gutter in the histogram this guard protects, and the prose gate inside relative-valley acceptance rejects any residual table-shaped split. Without the fallback, the prose remainder of a table-bearing two-column page fell to single-column Y-sorting and its columns interleaved line by line.
The 100-item floor guarded against shallow histogram dips on sparse pages, but OCR'd multi-column pages produce few long line-runs (a two-column French academic page arrives as ~60 items) and were falling to single-column Y-sorting, weaving their columns line by line. The prose gate inside relative-valley acceptance is the real defense against spurious dips; 30 items is enough for it to judge.
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
Removing page_has_table from the relative-valley condition also unlocked the XY-cut fallback inside that block, which has no prose gate — a table page whose valley candidate was just rejected could take an unvalidated split. The guard is restored on that call specifically; the relative-valley path keeps its prose-gated access. Also rewrite the stale dense-page comment for the 30-item floor. Bench and corpus unchanged (462/884, corpus byte-identical).
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would require human review. Expands relative-valley column detection to table-bearing and sparse pages (removes table guard, lowers item floor 100→30). This broader heuristic rollout and threshold change require human sign-off; the claimed improvements rely on external benchmarks not visible in the diff.
Re-trigger cubic
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.
What
Two gates in relative-valley column detection were starving real multi-column pages of their gutters, dropping them to single-column Y-sorting where the columns interleave line by line:
page_has_tableguard predates item claiming — by grouping time the detected table's items have already left the flow, so a table cannot fake a gutter in the histogram the guard protects. The prose gate inside relative-valley acceptance is the real defense, and it stays. Without the fallback, the prose remainder of a table-bearing two-column page wove line by line.Results
🤖 Generated with Claude Code
Summary by cubic
Restores relative‑valley column detection on table-bearing and sparse pages to prevent interleaved reading order. Previously it required ≥100 items and no detected tables; now it runs with ≥30 items regardless of tables, and the XY‑cut fallback is re‑guarded on table pages.
Written for commit dfe64b8. Summary will update on new commits.