Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ words:
- Antlr
- antlr
- Blockquotes
- CanvasNet
- Postconditions
- buildmark
- buildtransitive
Expand Down
20 changes: 11 additions & 9 deletions .fileassert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ tests:

# --- PACKAGE ---
# The Tool package previously ballooned to ~435 MB because native SkiaSharp runtime
# assets shipped with their debug symbols (.pdb) alongside the binaries. These tests
# just guard against that regression: the packed size stays under budget, the tool's
# main assembly and README are present, and no .pdb files leak into the native
# runtimes folder.
# assets shipped with their debug symbols (.pdb) alongside the binaries. Since the
# CanvasNet migration replaced SkiaSharp with a pure-managed renderer, the tool no
# longer ships any native runtime assets at all. These tests guard against a
# regression back to native assets: the packed size stays under a much smaller
# budget, the tool's main assembly and README are present, and no "runtimes" folder
# (native or otherwise) exists in the package.

- name: Package_ToolSizeWithinLimit
description: "Tool package stays within its size budget"
tags: [package]
files:
- pattern: "artifacts/packages/DemaConsulting.SysML2Tools.Tool.*.nupkg"
count: 1
max-size: 73400320 # 70 MiB
max-size: 10485760 # 10 MiB

- name: Package_ToolContentsValid
description: "Tool package contains its main assembly and README, with no stray native symbol files"
description: "Tool package contains its main assembly and README, with no native runtime assets"
tags: [package]
files:
- pattern: "artifacts/packages/DemaConsulting.SysML2Tools.Tool.*.nupkg"
Expand All @@ -37,9 +39,9 @@ tests:
- pattern: "tools/net10.0/any/DemaConsulting.SysML2Tools.dll"
min: 1
max: 1
# Native SkiaSharp runtime assets must not ship with .pdb symbol files -
# this is what caused the historical ~435 MB package-size bloat.
- pattern: "tools/net10.0/any/runtimes/**/*.pdb"
# The tool is now a pure-managed package (post-CanvasNet migration):
# no "runtimes" folder of any kind - native or otherwise - should ship.
- pattern: "tools/net10.0/any/runtimes/**"
max: 0

# --- BUILD NOTES ---
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
suitable for architecture documentation, CI/CD pipelines, and AI-assisted modeling
workflows.
- **languages**: C#
- **technologies**: .NET, ANTLR4, SkiaSharp
- **technologies**: .NET, ANTLR4, CanvasNet

# Project Structure

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ documentation, CI/CD pipelines, and AI-assisted modeling workflows.
engine with orthogonal specialization and membership edges, depth-coded fill colors, compartments,
and configurable depth limiting
- **SVG Output**: Zero external dependencies
- **PNG Output**: Pixel-identical across Windows, Linux, and macOS via SkiaSharp and an
- **PNG Output**: Pixel-identical across Windows, Linux, and macOS via CanvasNet and an
embedded Noto Sans font
- **NuGet Library**: Publishable packages with a stable public API — use the parser,
semantic model, or layout engine independently of the CLI tool
Expand Down
12 changes: 5 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ runs 9 tests following the `SysML2Tools_{Capability}SelfTest` naming convention:
lint, SVG render, PNG render, dynamic-view SVG/PNG render, dynamic-view filtered render, and
export — but every render test (SVG, PNG, and dynamic-view) exercises only the **General View**
(`SelfTestModel`'s `GeneralView`). Add one SVG+PNG-validating test per remaining view kind so
SkiaSharp native assets and each view's layout strategy are exercised on every OS:
the rendering pipeline and each view's layout strategy are exercised on every OS:

| Test | Proves |
|---|---|
Expand All @@ -126,17 +126,15 @@ size bloat and verifying the main assembly/README are present with no stray nati
open:

1. **Tool smoke test:** install the packed tool from a local feed into a clean directory → run
`--version`, render a sample to **both SVG and PNG** (PNG proves SkiaSharp natives resolve),
and `--licenses`.
`--version`, render a sample to **both SVG and PNG** (PNG exercises the managed CanvasNet
renderer), and `--licenses`.
2. **Library-consumer smoke test:** a throwaway project referencing each library package from the
local feed → restore → exercise parse→layout→render-to-SVG-in-memory and render-to-PNG (again
proving SkiaSharp natives for `.Png` consumers).
local feed → restore → exercise parse→layout→render-to-SVG-in-memory and render-to-PNG.

### Licensing, docs, gallery, publish

- **Licensing/attribution:** `--licenses` output covering Noto Sans (SIL OFL 1.1) and other OTS;
per-package README notes incl. the SkiaSharp native-assets requirement for
`DemaConsulting.SysML2Tools.Png` consumers.
per-package README notes.
- **Documentation:** README and User Guide state that the Geometry View is not yet supported.
Finalise the layout-algorithm reference in `docs/` and wire it into CI (`build.yaml`,
`.fileassert.yaml`, `.reviewmark.yaml`).
Expand Down
22 changes: 11 additions & 11 deletions docs/design/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,15 @@ Review-sets: defined in `.reviewmark.yaml`
| Language / runtime | C# / .NET 8+ | MIT |
| Parser generator | ANTLR4 (`Antlr4.Runtime.Standard`) | BSD-3-Clause |
| SysML v2 grammar | `antlr/grammars-v4` (official OMG KEBNF) | MIT |
| PNG rendering | SkiaSharp | MIT |
| PNG rendering | CanvasNet | MIT |
| Embedded font | Noto Sans | SIL OFL 1.1 |
| Test results output | `DemaConsulting.TestResults` | — |
| Unit testing | xUnit v3 | Apache 2.0 |

No ImageSharp dependency. The off-the-shelf `DemaConsulting.Rendering.Skia` PNG renderer uses
SkiaSharp, chosen over ImageSharp to avoid the Six Labors Split License, which would impose
licensing obligations on library consumers embedding the renderer in commercial products.
No ImageSharp dependency. The off-the-shelf `DemaConsulting.Rendering.CanvasNet` PNG renderer uses
CanvasNet, a pure-managed rendering library, chosen over ImageSharp to avoid the Six Labors Split
License, which would impose licensing obligations on library consumers embedding the renderer in
commercial products.

## Architectural Decisions

Expand All @@ -293,10 +294,10 @@ in native graphics binaries. The `IRenderer` interface is the extension point.
any user files are parsed. Single-file input is the degenerate case of a multi-file
workspace; there is no single-file mode.

**SkiaSharp over ImageSharp.** SkiaSharp is MIT-licensed. ImageSharp v2+ uses the
**CanvasNet over ImageSharp.** CanvasNet is MIT-licensed. ImageSharp v2+ uses the
Six Labors Split License which imposes obligations on commercial library consumers.
SkiaSharp's native asset requirement is transparent for tool consumers (handled by
NuGet at publish time) and is a known, documented constraint for library consumers.
CanvasNet is a pure-managed library with no native asset requirement, so this
constraint no longer applies to tool or library consumers.

**Embedded Noto Sans font.** Ensures pixel-identical PNG output across all platforms.
Noto Sans is licensed SIL OFL 1.1 which explicitly permits embedding in software.
Expand Down Expand Up @@ -351,10 +352,9 @@ tests the integrated tool, not just unit-level components.
SARIF output can be added as a formatting option on the existing infrastructure
without any breaking changes.

**SkiaSharp native assets for library consumers.** Consumers referencing the off-the-shelf
`DemaConsulting.Rendering.Skia` PNG renderer must ensure the appropriate
`SkiaSharp.NativeAssets.*` package is included in their publish output. This must
be documented clearly in the package README.
**Pure-managed rendering — no native assets required.** Consumers referencing the
off-the-shelf `DemaConsulting.Rendering.CanvasNet` PNG renderer have no native asset
package to add: CanvasNet is a pure-managed .NET library with no P/Invoke dependency.

**Noto Sans SIL OFL attribution.** OFL requires the copyright notice and license
text to be included in distributions. Must appear in NuGet package notices and the
Expand Down
4 changes: 2 additions & 2 deletions docs/design/sysml2-tools-core/rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Rendering subsystem wires together the rendering pipeline for SysML2 Tools. It bridges the
Layout subsystem (which produces a `LayoutTree`) and the off-the-shelf renderer packages
(`DemaConsulting.Rendering.Svg` and `DemaConsulting.Rendering.Skia`) using the contracts that
(`DemaConsulting.Rendering.Svg` and `DemaConsulting.Rendering.CanvasNet`) using the contracts that
both sides must satisfy.

The SysML-agnostic rendering contracts — `IRenderer` (low-level render interface), `Theme`
Expand Down Expand Up @@ -179,7 +179,7 @@ flowchart TD
`DemaConsulting.SysML2Tools.Semantic`; the `using` directive `using DemaConsulting.SysML2Tools.Semantic;`
is required in `ILayoutStrategy.cs` and `DiagramRenderer.cs`.
- The `IRenderer` implementations come from the off-the-shelf `DemaConsulting.Rendering.Svg` and
`DemaConsulting.Rendering.Skia` packages, referenced by the Tool via `<PackageReference>`.
`DemaConsulting.Rendering.CanvasNet` packages, referenced by the Tool via `<PackageReference>`.

### Requirements Traceability

Expand Down
2 changes: 1 addition & 1 deletion docs/design/sysml2-tools-tool/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ future-locale story, which applies identically here.
qualified view names, and `SynthesizeDynamicView` used by `TryProcessDynamicView` to build the
ad-hoc view node for `--view-type`/`--view-target`/`--filter`
- `SvgRenderer` (in `DemaConsulting.Rendering.Svg`) — produces SVG output
- `PngRenderer` (in `DemaConsulting.Rendering.Skia`) — produces PNG output
- `PngRenderer` (in `DemaConsulting.Rendering.CanvasNet`) — produces PNG output
- `Themes.Light` (in `DemaConsulting.Rendering.Abstractions`) — default theme
- `Context`/`RenderCommandOptions`/`RenderArgumentParser` (in `DemaConsulting.SysML2Tools.Cli`
and `DemaConsulting.SysML2Tools.Render`) — reads arguments; writes output
Expand Down
11 changes: 3 additions & 8 deletions docs/design/sysml2-tools-tool/self-test/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,12 @@ with `WorkspaceLoader.LoadAsync`, calls `DiagramRenderer.RenderWorkspace` with
`outputs.Count > 0 && outputs[0].Data.Length > 0`. Records pass or fail. Any exception is
caught and recorded via `HandleTestException`.

**RunRenderPngSelfTestAsync**: Verifies that `SelfTestModel` renders to a non-empty PNG stream,
or skips gracefully when SkiaSharp is unavailable.
**RunRenderPngSelfTestAsync**: Verifies that `SelfTestModel` renders to a non-empty PNG stream.

- *Parameters*: `Context context`, `DemaConsulting.TestResults.TestResults testResults`.
- *Returns*: `Task`.

Calls `NativeLibrary.TryLoad("libSkiaSharp", ...)` first. If the library is absent, records
the test as `Passed` with a skip message and returns early. Otherwise frees the handle, writes
`SelfTestModel` to a temp file, loads the workspace, calls `DiagramRenderer.RenderWorkspace`
Writes `SelfTestModel` to a temp file, loads the workspace, calls `DiagramRenderer.RenderWorkspace`
with `new PngRenderer()`, and asserts non-empty output. Records pass or fail. Any exception
is caught and recorded via `HandleTestException`.

Expand All @@ -105,9 +102,7 @@ distinct failure message when `diagnostic` is non-null or workspace loading fail
exception is caught and recorded via `HandleTestException`.

**RunRenderDynamicViewPngSelfTestAsync**: Mirrors
`RunRenderDynamicViewSvgSelfTestAsync` but with the PNG renderer, skipping gracefully (same
`NativeLibrary.TryLoad("libSkiaSharp", ...)` guard) when the native SkiaSharp library is
unavailable.
`RunRenderDynamicViewSvgSelfTestAsync` but with the PNG renderer.

- *Parameters*: `Context context`, `DemaConsulting.TestResults.TestResults testResults`.
- *Returns*: `Task`.
Expand Down
Binary file modified docs/gallery/png/AvionicsBrowserView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/BatterySubsystemView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/CarLineageGridView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/ComputerSystemInterconnectionView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/CoreLinkInterconnectionView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/DroneGeneralView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/ElevatorStateTransitionView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/GroundSegmentDirectChildrenView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/GroundSegmentRecursiveView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/MissionControlGeneralView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/MotorRigInterconnectionView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/OAuthSequenceView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/OperatorConsoleDeepView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/OperatorConsoleExactView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/PipelineActionFlowView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/TaxonomyMatrixView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/TokenExchangeSequenceView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/png/WorkstationInterconnectionView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 19 additions & 19 deletions docs/gallery/svg/MotorRigInterconnectionView.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/reqstream/ots/dema-rendering.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Requirements for the DemaConsulting.Rendering package family (DemaConsulting.Rendering,
# DemaConsulting.Rendering.Abstractions, DemaConsulting.Rendering.Layout,
# DemaConsulting.Rendering.Svg, DemaConsulting.Rendering.Skia) that SysML2Tools consumes for
# DemaConsulting.Rendering.Svg, DemaConsulting.Rendering.CanvasNet) that SysML2Tools consumes for
# SysML-agnostic layout and rendering. Each requirement is verified indirectly through SysML2Tools
# tests that drive the package family end-to-end.

Expand Down Expand Up @@ -91,7 +91,7 @@ sections:
title: >-
DemaConsulting.Rendering shall render a laid-out layout tree to a valid PNG image.
justification: |
SysML2Tools produces raster output through the package's Skia-based PngRenderer. The
SysML2Tools produces raster output through the package's CanvasNet-based PngRenderer. The
renderer must turn a LayoutTree into a valid PNG image, evidenced by PNG bytes
produced from an empty tree and from full workspace renders.
tags: [ots]
Expand Down
Loading
Loading