Skip to content

PDF fidelity (color spaces, functions, shadings, clip edge) and downstream-reported defects (PPTX footer/EMF, Visio theme/splines) - #49

Merged
Malcolmnixon merged 30 commits into
mainfrom
feature/pdf-fidelity-and-downstream-defects
Oct 13, 2026
Merged

Malcolmnixon merged 30 commits into
mainfrom
feature/pdf-fidelity-and-downstream-defects

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Pull Request

Description

PDF fidelity pass plus fixes for defects reported by a downstream consumer of beta.12.

PDF

  • CalGray, CalRGB and Lab convert to sRGB (CalRGB previously rendered as DeviceRGB, so documents using it
    change color). ICCBased still uses /Alternate or /N; ICC profile application is out of scope.
  • Separation and DeviceN (including /None and /All) through tint-transform functions; Indexed over any base.
  • FunctionType 4 (PostScript calculator) and multi-input FunctionType 0, with hard caps on instructions, stack,
    nesting and sample tables. DeviceN image conversion is memoized and has a per-image work budget
    (pdf-image-tint-budget).
  • Shading: any non-Pattern color space, stitching /Bounds as hard stops, interpolated mesh function lookup.
  • Clip fix: a fill edge lying on a rectangle-union clip edge was under-covered (coverage x coverage). Rectangle
    clips are now split into disjoint pieces and fills are clipped geometrically. Single-rectangle clips keep the
    analytic path.

PPTX

  • Non-placeholder text boxes honor their own lstStyle (footer date no longer wraps off the slide).
  • A slide with an EMF/WMF picture now renders the rest of the slide. OnUnsupportedPictureSkipped reports the
    skip and StrictUnsupportedPictures restores the throw (pptx-image-metafile). EMF rendering is out of scope.

Visio

  • Bare THEMEVAL() resolves to the "No Style" values instead of gray (fills, line, text color), the themed
    Font resolves to the theme minor typeface (Calibri), PolylineTo/NURBSTo/SplineStart/SplineKnot are
    flattened, and group children with their own master get their master merged. Non-solid fills are reported
    as vsdx-fill-pattern-N.

Tests/Hygiene

  • Stopwatch assertions in SvgCodecTests and the WaitAsync guards in PdfDocumentTests are replaced with
    deterministic counters.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Closes #

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully and all tests pass: pwsh ./build.ps1 (passed, 0 warnings, 0 errors)
  • Code produces zero warnings

Code Quality

  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: pwsh ./lint.ps1 (exit 0)

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated docs/ documentation (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

  • Local code review and formal review of the affected review sets were run; their findings (including an
    unbounded per-pixel DeviceN tint evaluation and an orphan requirement) are fixed in this branch.

  • Known gaps: EMF/WMF rendering, ICC profile application, Visio quick-style properties and InfiniteLine,
    mesh /None transparency, and rectangle-union clips still use coverage products for images and for curved or
    very large clips. Thin (0.33 unit) bars show a separate over-ink widening that was not investigated.

  • Not verified: Visio output was compared visually at low resolution against Visio's reference render; spline
    and polyline rows have only synthetic tests; the downstream consumer's slide-not-drawn test was not run.

  • All test files are synthetic; no customer files are committed.

  • Supersedes PDF fidelity (color spaces, functions, shadings, clip edge) and downstream-reported defects (PPTX footer/EMF, Visio theme/splines) #48, which GitHub closed when its head branch was renamed to remove a product name. Review findings raised there are already addressed in this branch.

Malcolm Nixon and others added 17 commits October 11, 2026 20:57
Remove Stopwatch assertions from SvgCodecTests in favor of an internal
SvgCodec.RenderDiagnostics (work charged, budget rejections, effects
surfaces/pixels allocated) reached via internal LoadWithDiagnostics.
Replace the linear-scan WaitAsync guard with a LinearScanStepCount linear
bound; drop WaitAsync from the int.MaxValue loop tests. Update
requirements, verification and design docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… (M2)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…input functions (M3)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nonlinear mesh tests (M4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…es keep full ink (M5)

A W* clip made only of several rectangles was a dense mask whose edge coverage
was multiplied into the fill's, losing up to ~40% ink where a fill edge
coincides with the clip edge. Decompose rectangle-union clips into disjoint
pieces and clip fills geometrically to them; add regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…slide-number box)

A master's date + slide-number text box is an ordinary non-placeholder shape
whose 12pt size lives only in its own txBody lstStyle. RenderShape passed a
null list style for non-placeholder shapes, so the text fell back to the 18pt
default, wrapped to a second line and ran off the slide bottom.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aration/DeviceN spaces

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A slide's own EMF/WMF <p:pic> now raises a distinct 'pptx-image-metafile' feature
and is skipped by default (rest of slide renders); skips are reported via
PptxRenderOptions.OnUnsupportedPictureSkipped and StrictUnsupportedPictures keeps
the previous throw. EMF/WMF rendering remains a known gap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ad of gray

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…le typeface

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nor font

The vsdx-document model still said themed values fall back to a neutral
default; describe the No Style StyleSheet and theme minor Latin resolution
added in 6276205 and bdace6a.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d resolve group-child masters

Resolve the previously skipped curve geometry rows into line segments
(clamped rational B-spline sampled with de Boor), honoring xType/yType
and degree, with hard caps on control points (1024), degree (25) and
flattened segments (4096). Unevaluable splines degrade to a polyline and
report vsdx-geometry-spline-approximated; malformed or over-cap rows are
skipped and reported.

A group child with its own Master reference and no MasterShape match now
resolves against that master, so stencil shapes nested in groups (for
example a pump symbol) inherit their geometry and line weight.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tern-N

A gradient/hatch FillPattern (above 1) is still drawn solid with the
foreground color, but is now reported through the existing
UnsupportedFeatureHandler channel with a distinct token instead of
degrading silently. The unresolved themed-color message now names both
the theme and the No Style fallback. No public API changes; geometry
rows still unsupported or approximated were already reported with the
distinct vsdx-geometry-row-<Type> and vsdx-geometry-spline-approximated
tokens.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…k budget

Memoize DeviceN image pixels by raw sample tuple (65536-entry cap), charge
uncached evaluations against a 2^30-unit per-image budget (fail closed with
pdf-image-tint-budget), and add byte-aligned sampled-function ReadSample.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…wn metafile skips

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…l with branch behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… themed text color slots and keep default for missing font

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 12, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Malformed Visio curve rows can draw unintended geometry or be skipped without the required diagnostic.

3 open findings
What changed in this PR

This PR improves rendering fidelity in CanvasNet’s PDF, PPTX, and Visio packages while replacing timing-based checks with deterministic diagnostics.

Changes:

  • Adds PDF color-space and function support, improves shading, and fixes rectangle-union clip edges.
  • Improves PPTX footer styling and EMF/WMF handling, plus Visio theme, master, and curve resolution.
  • Expands tests and updates requirements, design, verification, and user documentation.
File Description
test/​DemaConsulting.CanvasNet.Vsdx.Tests/​VsdxUnsupportedFeatureTests.cs Tests fill-pattern reports.
test/​DemaConsulting.CanvasNet.Vsdx.Tests/​VsdxThemedFallbackTests.cs Tests themed fallbacks.
test/​DemaConsulting.CanvasNet.Vsdx.Tests/​VsdxStyleResolutionTests.cs Updates themed-color expectations.
test/​DemaConsulting.CanvasNet.Tests/​Drawing/​ClipMaskTests.cs Tests rectangle-union clipping.
test/​DemaConsulting.CanvasNet.Svg.Tests/​SvgCodecTests.cs Uses deterministic work counters.
test/​DemaConsulting.CanvasNet.Pptx.Tests/​PptxSystemIntegrationTests.cs Tests metafile handling end to end.
test/​DemaConsulting.CanvasNet.Pptx.Tests/​PptxRenderTests.cs Tests footer styling and picture handling.
test/​DemaConsulting.CanvasNet.Pptx.Tests/​PptxImagesTests.cs Tests metafile feature tokens.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfSystemIntegrationTests.cs Tests mesh-function rendering.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfFixtureTests.cs Tests color-space fixtures.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfFixtures/​README.md Describes new PDF fixtures.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfDocumentShadingFidelityTests.cs Tests shading boundaries and domains.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfDocumentMeshShadingTests.cs Tests mesh colors and functions.
test/​DemaConsulting.CanvasNet.Pdf.Tests/​PdfDocumentClipEdgeInkTests.cs Tests clip-edge ink coverage.
src/​DemaConsulting.CanvasNet/​Drawing/​ScanlineRasterizer.cs Avoids dense multiplication for clip pieces.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxTheme.cs Reads the theme’s minor font.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.TextStyle.cs Resolves themed text and fonts.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.Paint.cs Resolves paint fallbacks and reports patterns.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.Groups.cs Resolves child masters.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.Geometry.cs Handles new curve rows.
src/​DemaConsulting.CanvasNet.Vsdx/​VsdxColorPalette.cs Supports theme-slot fallback checks.
src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.Filters.cs Records effects-surface allocations.
src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.Elements.cs Passes render diagnostics through.
src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.cs Adds an internal diagnostics entry point.
src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.Core.cs Tracks filter-work counters.
src/​DemaConsulting.CanvasNet.Pptx/​PptxRenderOptions.cs Adds metafile handling options.
src/​DemaConsulting.CanvasNet.Pptx/​PptxDocument.Render.cs Applies styling and picture-skip behavior.
src/​DemaConsulting.CanvasNet.Pptx/​PptxDocument.Images.cs Identifies EMF/WMF media.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Xref.cs Counts linear-scan work.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Patterns.Shading.Mesh.cs Interpolates mesh lookup colors.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Patterns.Shading.cs Adds shading color spaces and hard stops.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Patterns.cs Carries shading breakpoints.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Images.cs Converts image colors with bounded tint work.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.cs Updates PDF scope and scan diagnostics.
src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.ColorKernel.cs Converts calibrated colors and tints.
src/​DemaConsulting.CanvasNet.Pdf/​NamespaceDoc.cs Updates PDF capability documentation.
docs/​verification/​canvas-net/​drawing/​path-filler.md Records clip tests.
docs/​verification/​canvas-net-vsdx/​vsdx-document.md Records Visio feature tests.
docs/​verification/​canvas-net-vsdx.md Updates Visio integration coverage.
docs/​verification/​canvas-net-svg/​svg-codec.md Documents counter-based tests.
docs/​verification/​canvas-net-pptx/​pptx-document.md Records PPTX unit coverage.
docs/​verification/​canvas-net-pptx.md Records metafile integration coverage.
docs/​verification/​canvas-net-pdf.md Updates PDF integration coverage.
docs/​user_guide/​introduction.md Explains new rendering behavior and limits.
docs/​sysml2/​model/​canvas-net/​drawing/​path-filler.sysml Updates clip architecture description.
docs/​sysml2/​model/​canvas-net-svg/​svg-codec.sysml Documents internal diagnostics.
docs/​sysml2/​model/​canvas-net-pdf/​pdf-document.sysml Updates PDF architecture references.
docs/​reqstream/​canvas-net-vsdx/​vsdx-document.yaml Adds Visio feature requirements.
docs/​reqstream/​canvas-net-vsdx.yaml Links Visio requirements.
docs/​reqstream/​canvas-net-pptx/​pptx-document.yaml Adds PPTX behavior requirements.
docs/​reqstream/​canvas-net-pptx.yaml Links PPTX requirements.
docs/​reqstream/​canvas-net-pdf.yaml Links PDF feature requirements.
docs/​design/​introduction.md Maps new PDF components.
docs/​design/​canvas-net/​drawing/​path-filler.md Explains clip-piece rendering.
docs/​design/​canvas-net-vsdx/​vsdx-document.md Describes Visio resolution changes.
docs/​design/​canvas-net-vsdx.md Updates Visio limits and history.
docs/​design/​canvas-net-svg/​svg-codec.md Describes render-work diagnostics.
docs/​design/​canvas-net-pptx/​pptx-document.md Describes PPTX styling and metafile behavior.
docs/​design/​canvas-net-pdf.md Updates PDF feature design.
.reviewmark.yaml Tracks new PDF source and tests.
.cspell.yaml Adds technical spelling terms.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Malcolm Nixon and others added 3 commits October 12, 2026 08:09
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ometric image clip coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Report orphan SplineStart rows, validate NURBSTo and PolylineTo cells before
appending geometry, and skip malformed rows atomically with a diagnostic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 12, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The curated findings identify incorrect PostScript rounding, a silently skipped Visio curve row, and SVG allocation counters that underreport work.

3 open findings
3 resolved since last review

🧠 Review effort: Lite

…rasterizer regression tests, doc fixes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 12, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Mesh color interpolation needs correction, and two new SVG allocation assertions are commented out.

1 open finding
3 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Convert mesh colors after function interpolation

src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Patterns.Shading.Mesh.cs:859

For a mesh with /Function, the vertices' parameter is interpolated first, but this lookup blends already-converted 8-bit Rgba32 entries. With a nonlinear color space (for example, CalGray with a valid low /Gamma near the dark end), averaging the two converted colors can differ substantially from converting the function's interpolated components at that parameter. Retain function outputs in the lookup and convert after interpolation, or evaluate the function at the pixel parameter, so color-space conversion occurs in the correct order.

🧠 Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It spans several rendering pipelines, and unresolved diagnostic and resource-budget issues need human review.

0 open findings

Previously missed (2)

In code that hasn't changed since last review

Medium severity Charge filters for their initial content surface

src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.Filters.cs:1590

The added claim that the charge covers every allocated surface is not true for filters: ComputeEffectsPipelineWorkUnits charges primitiveCount × regionArea for a filter, but the pipeline also allocates its initial content surface. For a single feFlood, diagnostics count two region-sized surfaces while only one area's work is charged; repeatedly applying it can allocate about twice the surfaces implied by the 50-million-unit cumulative bound. Include one content-buffer unit when a filter applies (without changing the separate per-primitive cost), and adjust the budget/diagnostics tests accordingly.

Medium severity Report orphan NURBSTo and PolylineTo rows

src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.Geometry.cs:95

When NURBSTo or PolylineTo appears before any MoveTo, its new switch arm skips the row without calling ReportUnsupported (the analogous SplineKnot arm reports orphan rows). This hides missing geometry from the unsupported-feature handler and strict mode. Report vsdx-geometry-row-NURBSTo or vsdx-geometry-row-PolylineTo from the respective no-open-subpath branches, and cover both cases with regression tests.

🧠 Review effort: Lite

- SVG: filter work charge includes the content buffer (and SourceAlpha) without counting toward the primitive cap
- Vsdx: report subpath-continuing rows that appear before any MoveTo
- Tests, docs and reqstream updated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon

Copy link
Copy Markdown
Member Author

Addressed the two review-body findings in ac1d521: (1) SVG filters are now charged one content-buffer unit (plus one for a shared SourceAlpha buffer when used) in the per-filter and cumulative budgets, without counting toward the primitive cap; budget and diagnostics tests updated. (2) Visio rows that need an open subpath (NURBSTo, PolylineTo, LineTo, RelLineTo, ArcTo, EllipticalArcTo, RelCubBezTo, RelQuadBezTo, SplineStart) are now reported as vsdx-geometry-row-{Type} when they appear before any MoveTo, with a regression theory covering all nine.

Copilot AI lite review requested due to automatic review settings October 13, 2026 00:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It spans several renderers and has an unresolved SVG resource-budget issue, so final human validation is needed.

1 open finding

🧠 Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 00:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Metafile detection can still abort a slide for valid mixed-case media types, and malformed Visio spline degrees can draw an unintended curve.

0 open findings

1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Handle mixed-case metafile media types case-insensitively

src/​DemaConsulting.CanvasNet.Pptx/​PptxDocument.Images.cs:251

Media type tokens are case-insensitive, but IsMetafileContentType compares them with case-sensitive patterns. An OPC part declared as IMAGE/X-EMF therefore raises pptx-image-format instead of pptx-image-metafile, so the new default Render path throws instead of skipping that picture. Compare the four metafile media types with StringComparison.OrdinalIgnoreCase and include a mixed-case content type in the regression test.

Medium severity Reject invalid spline degree instead of defaulting to 3

src/​DemaConsulting.CanvasNet.Vsdx/​VsdxDocument.Splines.cs:71

BeginSpline validates X/Y/A/B/C but reads the required degree cell D with GetDouble("D", 3d), which substitutes 3 when D is missing, malformed, or non-finite. Such a SplineStart can therefore draw an unintended curve without reporting vsdx-geometry-row-SplineStart, contrary to the new malformed-row handling. Require a finite D before creating the accumulator, keep clamping valid out-of-range degrees, and add a regression case for an invalid D.

🧠 Review effort: Lite

…egree

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 01:13
@Malcolmnixon

Copy link
Copy Markdown
Member Author

Addressed the two review-body findings in c324e4f: (1) PPTX media types are now normalized (parameters dropped, trimmed, case-insensitive) before the metafile and raster decoder checks, so IMAGE/X-EMF takes the metafile skip path; mixed-case regression cases added. (2) Visio SplineStart now requires a finite degree cell D; a missing or non-finite D is reported as vsdx-geometry-row-SplineStart and skipped, while valid degrees are still clamped. Regression test added.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It spans several rendering engines and resource limits, with an unresolved malformed-function case and downstream scenarios not yet verified.

0 open findings

Previously missed (1)

In code that hasn't changed since last review

Medium severity Validate stitching bounds before rendering malformed functions

src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Functions.cs:457

A malformed stitching function can reach this new hard-stop logic because ResolveStitchingFunction only checks the length of /Bounds. For example, duplicate or out-of-order bounds can make a subfunction unreachable, while a non-finite bound is dropped here but still used by Evaluate to choose a subfunction. The renderer can silently paint incorrect colors instead of rejecting the malformed function. Validate finite, strictly increasing bounds inside a finite, increasing /Domain when resolving the function.

🧠 Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 01:40
@Malcolmnixon

Copy link
Copy Markdown
Member Author

Re "Validate stitching bounds before rendering malformed functions": fixed in 93a627e. Type 3 stitching functions now reject a non-finite or reversed /Domain, non-finite /Bounds, decreasing /Bounds, and bounds outside /Domain with InvalidDataException. Equal consecutive bounds remain accepted (used for hard color stops). Tests added for each case.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

PDF function-validation defects remain, and the broad rendering changes need final human review.

1 open finding
Previously missed (1)

In code that hasn't changed since last review

Medium severity Reject non-finite stitching function encode values

src/​DemaConsulting.CanvasNet.Pdf/​PdfDocument.Functions.cs:827

/Encode is checked for length but not for finite values. An overflowing PDF number can decode as infinity; StitchingFunction.Evaluate then passes a non-finite remapped input to its selected branch, potentially yielding invalid colors instead of rejecting the malformed function. Require every encode value to be finite, as the multi-input sampled-function parser already does.

🧠 Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 02:03
@Malcolmnixon

Copy link
Copy Markdown
Member Author

Re "Reject non-finite stitching function encode values": fixed in 39f4b08. Any non-finite /Encode value now throws InvalidDataException; test added.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-codec changes need human validation, and SVG drop-shadow work remains undercounted by the effects budget.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Undercharge compound feDropShadow filter work

src/​DemaConsulting.CanvasNet.Svg/​SvgCodec.Filters.cs:1616

feDropShadow still costs just one unit here, but ApplyFeDropShadow builds its own full-size alpha, blur, offset, flood, composite, and cropped output surfaces. The new per-filter and cumulative charges therefore undercount repeated drop shadows by several region-sized allocations, so documents can do substantially more work than the limits allow. Give this compound primitive a weighted charge based on its actual work and add a budget regression test; its internal scratch surfaces are distinct from the shared SourceAlpha input checked by FilterUsesSourceAlpha.

🧠 Review effort: Lite

@Malcolmnixon
Malcolmnixon merged commit b296bec into main Oct 13, 2026
7 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/pdf-fidelity-and-downstream-defects branch October 13, 2026 02:28
Malcolmnixon added a commit that referenced this pull request Nov 16, 2026
…ted Markdown (#148)

* Sync DEMA Agents files (Agents 5fb794e)

Copy the updated agent definitions, canvasnet skill, and shared standards, add the C++ standards, and merge the template-level AGENTS.md changes (C++ standards rows, LintMark configuration and tooling mentions) while keeping the CanvasNet-specific sections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Switch Markdown linting to LintMark

Add the demaconsulting.lintmark 0.1.0-beta.2 tool and .lintmark.yaml (template #49, with the CanvasNet ignores carried over from .markdownlint-cli2.yaml), run it from lint.ps1 and fix.ps1 instead of markdownlint-cli2, drop the node/npm VersionMark captures and the Node.js setup of the quality job, and capture the LintMark version there. package.json keeps only the pinned mermaid and mermaid-cli used by the tools/visual-diff developer scripts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move inline spell-check directives into TextLint overrides

Adopt the template #45 .textlint.yaml guidance (where an exception belongs, overrides), add lintmark to the words, and replace the inline cspell directives of the seven Mermaid link-check test files, the StateModel verification design, the PngSuite tests, and the two fuzz random tests with overrides scoped to exactly those files (the fuzz hex literals are already covered by the hexadecimal-literal pattern). Narrow the Mermaid math-vector and entity-marker patterns that were global to the upstream vector files that need them, and scope the C++ standard terms to the C++ standards.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep the LintMark and TextLint configuration comments stable under yamlfix

Reword the comments that yamlfix re-indented (a nested '#' in the fragment-markdown note and the override examples) and wrap the AGENTS.md technologies line to the 120-column LintMark limit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Exclude build output and test results from LintMark

The test projects copy their fixture READMEs into bin/, so a local lint after a build reported them; ignore bin/, obj/, and TestResults/ as .textlint.yaml already does.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Format Markdown with LintMark

Apply 'dotnet lintmark --fix' repository-wide: asterisk emphasis, compact tables with blank lines around them, dash bullets, and paragraphs re-wrapped to the 120-column limit. No wording changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite the over-wide tables of the user guides

Turn the tables whose rows exceed the 120-column LintMark limit into definition lists ('**term**: text', '**key** (default value): meaning', or a term with sub-bullets for a matrix), with a lead-in where the table header carried meaning; shorten or split rows, or move a detail into the sentence after the table, where only a few rows were a little too wide. Update the sentences that pointed at a converted table, and drop the markdownlint MD013 comments that LintMark no longer needs (it exempts tables from the line length).

The help-card parity tests (HelpTopicsTests) now read the definition lists of the Mermaid guide's syntax, relation, tag, setting, and code sections and the tool guide's Flatten Reference and File Access Reference sections instead of their tables; the comparison with the cards is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite the over-wide tables of the design documents

Turn the tables whose rows exceed the 120-column LintMark limit into definition lists: each external interface with its direction and format in parentheses, each limit or setting with its default, and a term with labeled sub-bullets where a table had several descriptive columns; add a lead-in where the header carried meaning, and update the sentences that pointed at a converted table. Where only a row or two were too wide, shorten them, split them, or move a detail into a note or sentence after the table (canvas-net.md, image-pipeline.md, scad-parser.md, scad-evaluator.md, discovery-commands.md).

Also drop the markdownlint MD013 comments that LintMark no longer needs, and re-wrap the three paragraphs LintMark could not wrap (a code span too long for one line in title-builder.md, and irregular continuation lines in legend-builder.md and scale-resolver.md). No wording changes beyond those.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Re-wrap two verification paragraphs that LintMark could not wrap

Collapse the stray runs of spaces and the irregular continuation indentation in time-calendar.md and sandboxed-file-resolver.md so LintMark can wrap them to 120 columns; whitespace only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite the over-wide tables of the test fixture READMEs

Turn the fixture tables whose rows exceed the 120-column LintMark limit (long file names and upstream URLs) into definition lists, keeping every file name, URL, and description, and drop the markdownlint MD013 comments that LintMark no longer needs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants