Skip to content

PPTX chart values shift when the category or numeric cache has gaps #220

Open

Description

@Yzzz88

Problem

Converting a PowerPoint chart with a missing data point can silently attach a later value to the wrong category. This makes Markdown extracted from course slides unreliable as knowledge-base input.

Reproduction

On AnyDoc 0.2.4 at current main e7178e0, generate a valid slide with PptxGenJS using the following script:

const PptxGenJS = require("pptxgenjs");
const deck = new PptxGenJS();
const slide = deck.addSlide();
const actual = [12];
actual[2] = 27;
const labels = ["Week 1", "Week 2", "Week 3"];
slide.addChart(deck.ChartType.bar, [
  { name: "Actual", labels, values: actual },
  { name: "Target", labels, values: [10, 20, 30] },
], { x: 0.5, y: 0.5, w: 8, h: 4 });
deck.writeFile({ fileName: "sparse.pptx" });

Convert sparse.pptx using AnyDoc. The actual series in ppt/charts/chart1.xml has c:pt idx="0" with value 12 and c:pt idx="2" with value 27. There is no point at index 1.

Category Actual result Expected result
Week 1 12 12
Week 2 27 empty
Week 3 empty 27

The fully populated Target series (10, 20, 30) remains correct.

Diagnosis

chart_blocks collects numeric cache values into a dense vector and looks them up by category row position. Looking up the value by its c:pt idx preserves gaps. I reproduced the shift on the actual slide and with a failing regression, then verified the local fix against the same input. I plan to submit the focused patch.

Downstream impact verified

Tencent/WeKnora main at e3fb2335bf3f8cadd32142380c60b2677a27bf99 pins AnyDoc v0.2.4. The tagged AnyDoc converter reproduced the same shifted rows. I passed its actual Markdown output and the patched output into WeKnora's HTML-table normalization and both single-level and parent-child chunking. The v0.2.4 output preserved the wrong Week 2 value in the text returned by EmbeddingContent, while the patched output preserved the correct empty Week 2 and Week 3 value 27. This was a local converter-to-chunker probe. It did not run WeKnora's native CGo binding or a live embedding/index backend.

Missing category labels

A second schema-validated PptxGenJS sample omits category index 1 while retaining the numeric points 0, 1 and 2. It uses multiLvlStrCache with one level, despite having a flat axis. The previous local patch still displayed Week 3 as 20 and dropped 27. With category and numeric indices aligned, the same file produces Week 1 = 12, an unlabeled row = 20, and Week 3 = 27. The numeric-gap sample still keeps Week 2 empty and Week 3 = 27. The patch retains upper-level labels in the flattened Markdown view without attaching numeric values to those labels.

Activity

  1. changed the title [-]PPTX chart values shift to the wrong categories when the numeric cache has gaps[/-] [+]PPTX chart values shift when the category or numeric cache has gaps[/+] on Nov 7, 2026
  2. Yzzz88 commented on Nov 7, 2026

    @Yzzz88
    Author

    I reproduced the downstream impact with two synthetic PPTX files and independently built converters. The control was AnyDoc v0.2.4 (42bf1c5), the version pinned by WeKnora. The patched converter was built from this issue's local fix on e7178e0.

    At WeKnora main e3fb2335, I ran the actual normalization and both chunking modes, then inspected the text intended for embedding. Both modes preserved these outcomes:

    • Category cache gap: v0.2.4 attaches 20 to Week 3 and drops 27. The patch preserves the unlabeled row with 20 and gives Week 3 its 27.
    • Numeric cache gap: v0.2.4 moves 27 to Week 2. The patch leaves the missing Week 2 value empty and keeps 27 in Week 3.

    The actual read_document tool and model-result renderer showed the same difference for the query Week 3 using an in-memory chunk repository. This exercise did not use a deployed WeKnora instance, a vector database, or a model call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions