Skip synthetic "_simple_" line style in catalogue pre-warm (#286)#288
Merged
Conversation
The S-100 Part 9A Lua portrayal model emits LineInstruction /
AreaInstruction outline references with the inline "_simple_" line-style
sentinel, whose colour, width, and dash travel on the instruction itself
rather than via a named complex line style in the portrayal catalogue.
CataloguePreWarm resolved it like any other line style, so every S-101
dataset load drove three KeyNotFoundException throws ("Line style
'_simple_' not found in the portrayal catalogue") that were caught and
discarded but never cached — re-thrown on each load.
Recognise the sentinel (new LineInstruction.SimpleLineStyleReference
constant) and skip the catalogue lookup. Rendering already drew these as
plain inline lines, so behaviour is unchanged minus the exceptions.
Adds a unit test for the pre-warm skip and a skippable real-data
regression test asserting zero KeyNotFoundExceptions when building an
S-101 vector portrayal.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6 tasks
Contributor
Performance Gate✅ PASSED — no regressions. Threshold: 10.0%, MAD multiplier (k): 3.0, retry-zone mult: 2.0× Scenario summary
exchange-set-openIteration statistics
Spans (sum of all iterations)
Metrics
s101-portray-coldIteration statistics
s101-portray-warmIteration statistics
s101-real-coldIteration statistics
s101-real-warmIteration statistics
s101-render-warmIteration statistics
s102-coverageIteration statistics
s102-coverage-openIteration statistics
Spans (sum of all iterations)
Metrics
s102-coverage-render-largeIteration statistics
s102-real-warmIteration statistics
s111-real-warmIteration statistics
s124-vectorIteration statistics
s201-vectorIteration statistics
Generated by EncDotNet.S100.PerfReport gate command |
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.
Summary
Fixes the three
KeyNotFoundExceptionthrows on every S-101 dataset load reported in #286.The S-100 Part 9A Lua portrayal model emits
LineInstruction/AreaInstructionoutline references using the inline_simple_line-style sentinel (fromPortrayalModel.lua'sSimpleLineStyle). Its colour, width, and dash pattern travel on the instruction itself — it is never a named complex line style in the portrayal catalogue.CataloguePreWarmresolved it like any other line style, so each load threw:…three times. The exceptions were caught and discarded but never cached, so they were re-thrown on every subsequent load.
Change
LineInstruction.SimpleLineStyleReferenceconstant ("_simple_") documenting the Part 9A sentinel.CataloguePreWarmnow skips it for bothLineInstruction.LineStyleReferenceandAreaInstruction.OutlineStyleReference. Rendering already drew these as plain inline lines (colour token present ⇒ no catalogue lookup), so portrayal output is unchanged — minus the exceptions.Tests
CataloguePreWarmTests— unit cover: the sentinel is not resolved against the catalogue; named line styles still are.S101SimpleLineStyleRegressionTests— skippable real-data regression: building an S-101 vector portrayal raises zeroKeyNotFoundExceptions. Verified against UKHO/IC-ENC trial cells; reverting the fix reproduces exactly the 3 throws from [Bug]: Performance of S101 multiple datasets #286.Full
EncDotNet.S100.Pipelines.Testssuite: 584 passed, 1 skipped.Out of scope
This PR does not address the per-dataset memory growth (50–100 MB/cell) also noted in #286 — that stems from the render-side caches (Mapsui scene/style/pattern-clip/tile) that back smooth pan/zoom, and warrants a more careful eviction-policy design. Tracked in a separate follow-up issue.
Closes #286 (exception portion); memory portion tracked separately.