RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(deepdoc): propagate spanning-cell bbox so Go emits correct colspan (#18707)
Jack4b6346b05220
diff --git a/internal/deepdoc/parser/pdf/one_pdf_colspan_e2e_test.go b/internal/deepdoc/parser/pdf/one_pdf_colspan_e2e_test.gonew file mode 100644index 0000000000..64b11e0f9e--- /dev/null+++ b/internal/deepdoc/parser/pdf/one_pdf_colspan_e2e_test.go@@ -0,0 +1,76 @@+//go:build cgo && manual++package pdf++import (+ "os"+ "path/filepath"+ "strings"+ "testing"++ "ragflow/internal/common"++ pdf "ragflow/internal/deepdoc/parser/pdf/type"+)++// Test1PdfColspanEndToEnd parses real_pdfs/1.pdf through the PRODUCTION path+// (real DLA+TSR+OCR against DEEPDOC_URL) and asserts the table HTML carries+// colspan="6" on the merged header — matching Python's golden+// (output/py/ocr_real/tables/1.pdf.json: row0 collapses to 3 text cells+// because the header spans 6 of the 8 columns).+//+// This is the end-to-end closure for the Go assembly bug fixed in+// AnnotateTableBoxes: Go was copying the spanning cell's bbox+// (H_left/H_right/H_top/H_bott) onto the overlapping box ONLY for header+// cells, not for "spanning cell" (SP) boxes. Without that propagation,+// GroupBoxesByRC rebuilt the span cell from the box's own narrow bounds and+// CalSpans covered only 5 columns, so Go emitted colspan=5 where Python+// emits colspan=6. TSR input is identical on both sides, so the divergence+// was purely a Go assembly bug, not a model issue.+//+// Requires DEEPDOC_URL (OSS DeepDoc) reachable; skips otherwise.+func Test1PdfColspanEndToEnd(t *testing.T) {+ client := mustConnectInferenceClient(t)++ pdfDir := common.GetEnv("BATCH_PARITY_PDF_DIR")+ if pdfDir == "" {+ pdfDir = "testdata/real_pdfs"+ }+ pdfPath := filepath.Join(pdfDir, "1.pdf")+ data, err := os.ReadFile(pdfPath)+ if err != nil {+ t.Fatalf("read 1.pdf: %v", err)+ }++ cfg := pdf.DefaultParserConfig()+ p := NewParser(cfg)+ result, err := p.Parse(t.Context(), data, client)+ if err != nil {+ t.Fatalf("Parse 1.pdf: %v", err)+ }+ if len(result.Tables) == 0 {+ t.Fatal("1.pdf: no tables detected")+ }++ // The colspan="6" lives in the <table> HTML injected into the sections+ // by ExtractTableAndReplace. Find the header cell spanning 6 columns.+ var allHTML strings.Builder+ for _, s := range result.Sections {+ allHTML.WriteString(s.Text)+ }+ html := allHTML.String()+ if !strings.Contains(html, "colspan=6") {+ t.Errorf("1.pdf: expected <th colspan=6> in production table HTML (matching Python golden), "++ "but colspan=6 not found. Go assembly still under-covers the span.\nHTML excerpt:\n%s",+ htmlExcerpt(html, 600))+ }++ _ = common.GetEnv // keep common import for parity with sibling tests+}++func htmlExcerpt(s string, n int) string {+ if len(s) <= n {+ return s+ }+ return s[:n] + "...(truncated)"+}diff --git a/internal/deepdoc/parser/pdf/table/annotate_span_coords_test.go b/internal/deepdoc/parser/pdf/table/annotate_span_coords_test.gonew file mode 100644index 0000000000..aa7af35fb3--- /dev/null+++ b/internal/deepdoc/parser/pdf/table/annotate_span_coords_test.go@@ -0,0 +1,60 @@+//go:build cgo && manual++package table++import (+ "testing"++ pdf "ragflow/internal/deepdoc/parser/pdf/type"+)++// TestAnnotateTableBoxesSpanCarriesBoxCoords verifies that AnnotateTableBoxes+// copies the spanning cell's bbox (H_left/H_right/H_top/H_bott) onto the+// overlapping box, matching Python's _annotate_table_boxes+// (pdf_parser.py:632-635: b["H_left"]=spans[ii]["x0"], b["H_right"]=spans[ii]["x1"]).+//+// This is what lets GroupBoxesByRC rebuild a grid cell whose X0/X1 equals the+// span box's full extent, so CalSpans covers every column the span crosses.+// Without it, cellPosFromBox (group_boxes.go) falls back to the box's own+// narrow bounds, CalSpans under-covers by one column, and Go emits+// colspan=5 where Python emits colspan=6 (real_pdfs/1.pdf). TSR input is+// identical on both sides, so the divergence is a Go assembly bug, not a+// model issue.+func TestAnnotateTableBoxesSpanCarriesBoxCoords(t *testing.T) {+ // grid[0][1] is a spanning cell spanning columns 1..6 (x0..x1 matches+ // 1.pdf's colspan=6 header region). Coordinates are in the same crop+ // space as the box below.+ grid := [][]pdf.TSRCell{+ {+ {X0: 0, Y0: 0, X1: 100, Y1: 20, Label: "table column"},+ {X0: 100, Y0: 0, X1: 500, Y1: 20, Label: "table spanning cell"},+ {X0: 500, Y0: 0, X1: 600, Y1: 20, Label: "table column"},+ },+ {+ {X0: 0, Y0: 20, X1: 100, Y1: 40, Label: "table column"},+ {X0: 100, Y0: 20, X1: 500, Y1: 40, Label: "table column"},+ {X0: 500, Y0: 20, X1: 600, Y1: 40, Label: "table column"},+ },+ }+ // A box that sits under the spanning cell (its own x0/x1 are narrow,+ // like the "名称" column in 1.pdf — only ~1 column wide).+ box := pdf.TextBox{+ X0: 110, X1: 200,+ Top: 2, Bottom: 18,+ Text: "液化石油气储罐(区)(总容积V,m²)",+ LayoutType: pdf.LayoutTypeTable,+ }++ boxes := []pdf.TextBox{box}+ AnnotateTableBoxes(boxes, grid)++ b := boxes[0]+ if b.HLeft != 100 || b.HRight != 500 {+ t.Errorf("span box H_left/H_right not propagated from spanning cell bbox: got HLeft=%v HRight=%v, want 100/500. "++ "This makes GroupBoxesByRC build a span cell with the box's narrow bounds, so CalSpans emits colspan=5 instead of colspan=6 (1.pdf).",+ b.HLeft, b.HRight)+ }+ if b.SP <= 0 {+ t.Errorf("SP not set on span-matching box: SP=%d", b.SP)+ }+}diff --git a/internal/deepdoc/parser/pdf/table/annotate_span_test.go b/internal/deepdoc/parser/pdf/table/annotate_span_test.gonew file mode 100644index 0000000000..a7816ac94b--- /dev/null+++ b/internal/deepdoc/parser/pdf/table/annotate_span_test.go@@ -0,0 +1,60 @@+//go:build cgo && manual++package table++import (+ "testing"++ pdf "ragflow/internal/deepdoc/parser/pdf/type"+)++// TestAnnotateTableBoxesPropagatesSpan verifies that AnnotateTableBoxes+// transfers the TSR "table spanning cell" recognition onto the overlapping+// OCR text box as SP>0. This is the bridge that lets GroupBoxesByRC rebuild a+// grid that still carries the span, so ConstructTable/CalSpans can emit+// colspan/rowspan.+//+// Root cause for 1.pdf (real_pdfs): AnnotateTableBoxes collected `headers`+// and `clmns` from the grid but NEVER populated the `spans` slice it later+// matched boxes against, so box.SP stayed 0 and the rebuilt grid lost every+// TSR span — Go emitted 8 independent empty <th> where Python emits+// <th colspan=6>. Python's _table_transformer_job sets b["SP"] from the+// spanning cells, so Go must too.+func TestAnnotateTableBoxesPropagatesSpan(t *testing.T) {+ // A 2-row × 2-col grid where row0 col0 spans both columns (colspan=2),+ // mirroring 1.pdf's wide header. Coordinates are in the same crop space+ // as the boxes below.+ grid := [][]pdf.TSRCell{+ {+ {X0: 0, Y0: 0, X1: 100, Y1: 20, Label: "table column"},+ {X0: 100, Y0: 0, X1: 200, Y1: 20, Label: "table column"},+ },+ {+ {X0: 0, Y0: 20, X1: 100, Y1: 40, Label: "table column"},+ {X0: 100, Y0: 20, X1: 200, Y1: 40, Label: "table column"},+ },+ }+ // Overlay a spanning cell across row0 (y0=0 y1=20), x0=0 x1=200.+ grid[0][1] = pdf.TSRCell{X0: 0, Y0: 0, X1: 200, Y1: 20, Label: "table spanning cell"}++ // A text box that sits inside the spanning cell region. LayoutType must+ // be "table" — AnnotateTableBoxes skips non-table boxes, and the+ // production caller (processOneTable) always passes the table region's+ // box subset with LayoutTypeTable set.+ box := pdf.TextBox{+ X0: 10, X1: 190,+ Top: 2, Bottom: 18,+ Text: "液化石油气储罐(区)(总容积V,m²)",+ LayoutType: pdf.LayoutTypeTable,+ }++ boxes := []pdf.TextBox{box}+ AnnotateTableBoxes(boxes, grid)++ if boxes[0].SP <= 0 {+ t.Errorf("AnnotateTableBoxes did not set SP on the box overlapping the TSR spanning cell (SP=%d). "++ "Without SP, GroupBoxesByRC rebuilds a grid with no span label and ConstructTable/CalSpans "++ "drops the colspan — Go emits 8 independent empty <th> instead of <th colspan=6>.",+ boxes[0].SP)+ }+}diff --git a/internal/deepdoc/parser/pdf/table/deepdoc_table_builder.go b/internal/deepdoc/parser/pdf/table/deepdoc_table_builder.goindex c629b9189f..005a724d4c 100644--- a/internal/deepdoc/parser/pdf/table/deepdoc_table_builder.go+++ b/internal/deepdoc/parser/pdf/table/deepdoc_table_builder.go@@ -128,7 +128,14 @@ func (b *DeepDocTableBuilder) GroupCells(cells []pdf.TSRCell) [][]pdf.TSRCell {}}}- if len(covered) < 2 {+ // A span box that covers only a single grid cell (e.g. a TSR+ // spanning cell whose box only reaches one row's center because the+ // model's box edge missed the neighbour row) is still a real TSR+ // span and must be labelled, not silently dropped. A 1-cell span+ // renders as rowspan=1/colspan=1 (harmless) but keeps the TSR+ // recognition visible downstream. Only skip when the box overlaps+ // no grid cell at all (genuine coordinate mismatch).+ if len(covered) == 0 {continue}sort.Slice(covered, func(a, b int) bool {diff --git a/internal/deepdoc/parser/pdf/table/table_layout.go b/internal/deepdoc/parser/pdf/table/table_layout.goindex 649a027d1e..a8d37e8798 100644--- a/internal/deepdoc/parser/pdf/table/table_layout.go+++ b/internal/deepdoc/parser/pdf/table/table_layout.go@@ -199,6 +199,17 @@ func AnnotateTableBoxes(boxes []pdf.TextBox, grid [][]pdf.TSRCell) {if isHeaderLabel(cell.Label) {headers = append(headers, cell)}+ // Collect spanning cells so the SP annotation is propagated to+ // overlapping boxes (Python _table_transformer_job appends every+ // "SP" cell to its `spans` list and matches boxes against it at+ // pdf_parser.py:518-554). Without this, box.SP stays 0, the+ // rebuilt grid (GroupBoxesByRC) loses the span, and+ // ConstructTable/CalSpans drops the colspan/rowspan — Go emits+ // independent empty <th> where Python emits <th colspan=6>+ // (e.g. real_pdfs/1.pdf).+ if strings.Contains(cell.Label, "spanning") {+ spans = append(spans, cell)+ }}}if len(grid) > 0 && len(grid[0]) > 0 {@@ -259,7 +270,22 @@ func AnnotateTableBoxes(boxes []pdf.TextBox, grid [][]pdf.TSRCell) {}}if idx := findOverlappedWithThreshold(boxes[i], spans, 0.3); idx >= 0 {- boxes[i].SP = idx+ // Offset by 1 so a box matching the FIRST spanning cell+ // (idx == 0) is distinguishable from "no span overlap" (the+ // default SP == 0). All readers check SP > 0, matching Python's+ // boolean SP semantics (pdf_parser.py:518-554).+ boxes[i].SP = idx + 1+ // Python _annotate_table_boxes (pdf_parser.py:632-635) copies the+ // spanning cell's bbox onto the box as H_top/H_bott/H_left/H_right.+ // GroupBoxesByRC then builds the span cell from these full extents+ // (cellPosFromBox uses HLeft/HRight when H>0), so CalSpans covers+ // every column the span crosses. Without this, the span cell falls+ // back to the box's own narrow bounds and Go emits colspan=5 where+ // Python emits colspan=6 (real_pdfs/1.pdf).+ boxes[i].HTop = spans[idx].Y0+ boxes[i].HBott = spans[idx].Y1+ boxes[i].HLeft = spans[idx].X0+ boxes[i].HRight = spans[idx].X1}}diff --git a/internal/deepdoc/parser/pdf/table/table_span_inject_test.go b/internal/deepdoc/parser/pdf/table/table_span_inject_test.gonew file mode 100644index 0000000000..1ea4cc1d3d--- /dev/null+++ b/internal/deepdoc/parser/pdf/table/table_span_inject_test.go@@ -0,0 +1,81 @@+//go:build cgo && manual++package table++import (+ "strings"+ "testing"++ pdf "ragflow/internal/deepdoc/parser/pdf/type"+)++// TestGroupCellsInjectsSpanning verifies that GroupCells propagates EVERY TSR+// "table spanning cell" label into the assembled grid — both the wide col-span+// header and the tall row-span header cell — instead of dropping a span whose+// box only reaches one row/column center.+//+// Repro from real_pdfs/1.pdf table 0 (tsr_raw coordinates, raw PDF points —+// GroupCells only compares relative positions, so no crop/scale mapping is+// needed here):+// - colspan spanning cell #17: x0=209.3 y0=112.2 x1=446.8 y1=138.0+// - rowspan spanning cell #18: x0=210.3 y0=135.3 x1=249.7 y1=229.7+//+// The real PDF cell "名称" spans TWO rows (rowspan=2); TSR only emits a span+// box that reaches row1's center (rowspan=1) — a known TSR-model limitation+// tracked separately. Go must still faithfully label BOTH TSR span boxes so+// the recognition is not lost; restoring the true rowspan=2 is the TSR model's+// job, not Go's. The previous code used `len(covered) < 2` to skip a span that+// covered only one cell, which dropped #18 entirely.+func TestGroupCellsInjectsSpanning(t *testing.T) {+ cells := []pdf.TSRCell{+ // 8 columns+ {X0: 422.5, Y0: 125.0, X1: 465.1, Y1: 727.3, Label: "table column"},+ {X0: 465.2, Y0: 125.0, X1: 503.1, Y1: 724.6, Label: "table column"},+ {X0: 81.1, Y0: 110.4, X1: 212.6, Y1: 726.2, Label: "table column"},+ {X0: 376.8, Y0: 125.0, X1: 422.4, Y1: 724.6, Label: "table column"},+ {X0: 287.2, Y0: 121.7, X1: 331.3, Y1: 724.6, Label: "table column"},+ {X0: 331.4, Y0: 125.0, X1: 376.9, Y1: 724.6, Label: "table column"},+ {X0: 249.4, Y0: 112.8, X1: 286.1, Y1: 726.3, Label: "table column"},+ {X0: 211.5, Y0: 113.2, X1: 249.5, Y1: 724.6, Label: "table column"},+ // 7 rows+ {X0: 80.3, Y0: 138.3, X1: 502.2, Y1: 231.4, Label: "table row"},+ {X0: 80.3, Y0: 290.8, X1: 502.4, Y1: 391.1, Label: "table row"},+ {X0: 79.9, Y0: 484.3, X1: 501.7, Y1: 576.8, Label: "table row"},+ {X0: 80.0, Y0: 578.1, X1: 501.7, Y1: 726.9, Label: "table row"},+ {X0: 80.3, Y0: 230.3, X1: 501.8, Y1: 290.6, Label: "table row"},+ {X0: 80.3, Y0: 111.4, X1: 503.0, Y1: 138.9, Label: "table row"},+ {X0: 80.0, Y0: 390.2, X1: 501.7, Y1: 484.3, Label: "table row"},+ // column header region+ {X0: 79.1, Y0: 110.9, X1: 503.6, Y1: 231.0, Label: "table column header"},+ // spanning cells (both must be labelled in the grid)+ {X0: 209.3, Y0: 112.2, X1: 446.8, Y1: 138.0, Label: "table spanning cell"},+ {X0: 210.3, Y0: 135.3, X1: 249.7, Y1: 229.7, Label: "table spanning cell"},+ }++ grid := (&DeepDocTableBuilder{}).GroupCells(cells)+ if grid == nil {+ t.Fatal("GroupCells returned nil grid")+ }++ spanCount := 0+ var spanPositions [][2]int+ for r, row := range grid {+ for c, cell := range row {+ if strings.Contains(cell.Label, "spanning") {+ spanCount+++ spanPositions = append(spanPositions, [2]int{r, c})+ }+ }+ }+ t.Logf("grid %dx%d, spanning cells injected: %d at %v",+ len(grid), len(grid[0]), spanCount, spanPositions)++ if spanCount != 2 {+ t.Errorf("expected BOTH TSR spanning cells (#17 colspan header + #18 rowspan '名称') "++ "to be labelled in the grid, got %d (positions=%v). "++ "GroupCells must not drop a span whose box only reaches one "++ "row/column center — the TSR recognition must be preserved "++ "(restoring the true rowspan=2 is the TSR model's job).",+ spanCount, spanPositions)+ }+}diff --git a/internal/deepdoc/parser/pdf/table/testdata/parity/known_diffs.json b/internal/deepdoc/parser/pdf/table/testdata/parity/known_diffs.jsonindex 7175a797da..723e322055 100644--- a/internal/deepdoc/parser/pdf/table/testdata/parity/known_diffs.json+++ b/internal/deepdoc/parser/pdf/table/testdata/parity/known_diffs.json@@ -200,7 +200,7 @@"RowsToStrings"],"permanent": true,- "reason": "These real-PDF tables carry TSR-detected 'table spanning cell' components (verified against the physical documents: screenshot's double-layer 泡点MPa column spans 4 rows; lazards' multi-level column-group headers span columns; dell/asset-recovery/prodeploy marketing templates merge the 服務附件/排除項目 column across rows; asset-recovery-sd's cross-page Terms table merges its first column rows 1-2 and first row cols 2-3). Go's GroupCells labels the span-origin cell 'table spanning cell', keeps every covered cell's row x column bbox, CalSpans folds the covered text into the span cell and tags covered cells, and downstream (goTableRows / RowsToStrings) drops covered cells so per-row column counts follow the span geometry. Python's __cal_spans only folds when a BOX carries an SP annotation, assigned by find_overlapped_with_threshold(box, spans, thr=0.3); when no box in the merged region overlaps the span component by >=30% (empty merged region, or small text boxes inside a large span bbox), Python emits NO colspan/rowspan and renders a flat grid with the merged columns repeated as empty cells. For these PDFs the Python golden shows zero colspan while the TSR spans are real, so Go's structure (merged cells, fewer columns per covered row) is judged at least as good as Python's flat grid. Deliberate divergence, not a regression target."+ "reason": "These real-PDF tables carry TSR-detected 'table spanning cell' components (verified against the physical documents: screenshot's double-layer 泡点MPa column spans 4 rows; lazards' multi-level column-group headers span columns; dell/asset-recovery/prodeploy marketing templates merge the 服務附件/排除項目 column across rows; asset-recovery-sd's cross-page Terms table merges its first column rows 1-2 and first row cols 2-3). Go's GroupCells labels the span-origin cell 'table spanning cell', keeps every covered cell's row x column bbox, CalSpans folds the covered text into the span cell and tags covered cells, and downstream (goTableRows / RowsToStrings) drops covered cells so per-row column counts follow the span geometry. Python's __cal_spans only folds when a BOX carries an SP annotation, assigned by find_overlapped_with_threshold(box, spans, thr=0.3); when no box in the merged region overlaps the span component by >=30% (empty merged region, or small text boxes inside a large span bbox), Python emits NO colspan/rowspan and renders a flat grid with the merged columns repeated as empty cells. For these PDFs the Python golden shows zero colspan while the TSR spans are real, so Go's structure (merged cells, fewer columns per covered row) is judged at least as good as Python's flat grid. Deliberate divergence, not a regression target. NOTE — direction is OPPOSITE to 1.pdf (rule table-1pdf-colspan-assembly-loss): here Go HAS the colspan and Python omits it (Go >= Python, so go_intentional); 1.pdf is the reverse — Python's golden HAS colspan=6 and Go used to DROP it (a Go assembly bug, now fixed). Do NOT add 1.pdf to this rule; it belongs to table-1pdf-colspan-assembly-loss as a resolved go_bug."},{"id": "table-11pdf-both-inaccurate-grid-shape",@@ -218,6 +218,25 @@"owner_fix_side": "neither","reason": "11.pdf is a multi-table PDF (Go emits 7 tables) whose grid shapes diverge from the Python golden: gridSim=91.8%, structSim=87.5% with Go grids 7x3 vs Python 11x3, textSim=87.4% (verified via TestPipelineParity with BATCH_PARITY_VARIANT=ocr_real). This is NOT a go_intentional divergence (Go is not judged better than Python) and NOT a trackable go_bug on either side: neither pipeline is the ground truth for this document's table structure, so the gap is not a regression target on the Go side nor something the Python golden can anchor. It is registered as ignore so the PDF is exempted from the FAIL count (reported as IGNORE) and does not block the parity gate, while the gap stays logged for a future re-examination of the golden/ground-truth table structure. Resolution requires re-establishing which grid (if either) is correct against the physical document before any code fix is attempted."},+ {+ "id": "table-1pdf-colspan-assembly-loss",+ "tag": "go_bug",+ "kind": "span_annotation_loss",+ "applies_to": [+ "1.pdf"+ ],+ "fields": [+ "AnnotateTableBoxes",+ "GroupBoxesByRC",+ "CalSpans",+ "cellPosFromBox"+ ],+ "owner_fix_side": "go",+ "status": "resolved_partial",+ "resolution": "AnnotateTableBoxes (internal/deepdoc/parser/pdf/table/table_layout.go) now (a) collects TSR 'spanning cell' components into its spans slice and sets box.SP = idx+1 on overlapping boxes (matching Python _table_transformer_job / pdf_parser.py:518-554), and (b) copies the span cell's bbox onto the box as H_top/H_bott/H_left/H_right (matching Python _annotate_table_boxes pdf_parser.py:632-635). GroupBoxesByRC then rebuilds the span cell from these full extents (cellPosFromBox uses HLeft/HRight when set) and CalSpans covers every column the span crosses. Before the fix, box.SP stayed 0 AND HLeft/HRight were not propagated for SP boxes, so the span cell fell back to the box's own narrow bounds and CalSpans covered only 5 columns -> Go emitted colspan=5 where Python emits colspan=6. After the fix Go emits colspan=6 (verified end-to-end via Test1PdfColspanEndToEnd on the live pipeline, and via TestPipelineParity replay: 1.pdf row0 went from 8 independent <th> to 4 cells, textSim 95.7% -> 97.4%). Regression: TestAnnotateTableBoxesSpanCarriesBoxCoords, TestAnnotateTableBoxesPropagatesSpan, TestGroupCellsInjectsSpanning, Test1PdfColspanEndToEnd.",+ "tracking": "Residual: 1.pdf's header row still shows row0 = 4 cells in Go vs 3 cells in Python's golden (structSim 87.5%, the LOCKED grid check still fails). The colspan=6 is correctly emitted, but Go keeps one extra empty spanning cell in row0 (4 vs 3), so the per-row column count is not yet byte-identical to Python. Left as resolved_partial: the colspan-assembly bug is fixed; the 1-cell row0 residual needs a follow-up on how GroupBoxesByRC folds the covered trailing column before 1.pdf can reach structSim=100% / aligned.",+ "reason": "1.pdf's merged header ('液化石油气储罐(区)(总容积V,m²)') spans 6 of the 8 columns. Python's golden carries colspan=6 on that header cell (its row0 collapses to 3 cells: 1 content + 2 empties around the 6-span). Go USED TO DROP the span: AnnotateTableBoxes only propagated the spanning cell's bbox (H_left/H_right/H_top/H_bott) onto header boxes, not onto 'spanning cell' (SP) boxes, and did not even collect the spans slice, so box.SP stayed 0 and the rebuilt grid (GroupBoxesByRC) lost the span; CalSpans then covered only the box's own narrow bounds -> colspan=5. TSR input is identical on both sides, so this was purely a Go ASSEMBLY bug, the OPPOSITE direction of rule table-span-follow-tsr-geometry (there Go HAS the colspan and Python omits it; here Python HAS it and Go dropped it). Direction matters for classification: this is a go_bug (Go was wrong, now fixed), NOT a go_intentional. Exposed by TestPipelineParity replay (1.pdf: LOCKED gridSim=100% structSim=87.5% regressed below 100%) and the end-to-end Test1PdfColspanEndToEnd."+ },{"id": "noncell-icbccs-caption-dropped","tag": "go_bug",