Skip to content

release: HyperMarkDown for VS Code 0.8.1 and hmd 0.6.1, with a higher Mermaid layout limit - #19

Merged
ewiger merged 1 commit into
mainfrom
fix/mermaid-layout-limit
Nov 29, 2026
Merged

ewiger merged 1 commit into
mainfrom
fix/mermaid-layout-limit

Conversation

@ewiger

@ewiger ewiger commented Nov 29, 2026

Copy link
Copy Markdown
Owner

The problem

A mermaid#show flowchart of 14 nodes and 21 edges was not drawn. The preview showed the renderer's message:

resource limit `max_layout_work_units` exceeded during layout_model: actual=127582 maximum=125000 cause=ceiling

Both tools run merman-cli with --resource-profile constrained, and that profile stops the layout at 125,000 units. No change to the source that keeps the diagram's meaning gets it under the limit.

The change

  • Both tools allow 250,000 units. They keep the constrained profile and add --resource-limit max_layout_work_units=250000. Every other budget stays as it is, and so does the 2-second render bound.
  • The extension has a setting for it. hyperMarkdown.diagram.mermaidLayoutLimit, default 250,000. The preview redraws when it changes. A value that is not a whole number of at least 1 means the default.
  • The error names the setting. A diagram over the limit says how many units it needs, what the limit is, and which setting to raise. Every other renderer failure is shown as the renderer wrote it.
  • hmd has the number as a constant, diagram.MAX_LAYOUT_WORK_UNITS. The site build has no option for it yet.

Versions

  • HyperMarkDown for VS Code 0.8.1
  • hmd 0.6.1

@hypermarkdown/core does not change.

Records

  • The board card for the issue and the decision, in doc/issues/archive/.
  • The Mermaid proposal states the new flag and that an implementation may let its user set the number.
  • Done rows in the extension's tracker and in the tracker of hmd, and an entry on the roadmap page.

Tests

  • The extension: typecheck, and 462 tests pass with MERMAN_BIN set to the bundled merman-cli 0.11.0.
  • Python: 934 tests pass with the bundled renderers on PATH.
  • Both suites draw, with the real renderer, a flowchart that the profile's own limit refuses.
  • hmd lint in doc/ is clean.

… Mermaid layout limit

A flowchart of 14 nodes and 21 edges was refused with "resource limit
`max_layout_work_units` exceeded". merman-cli's constrained profile stops
the layout at 125,000 units, and the flowchart needs 127,582.

Both tools keep the profile and pass --resource-limit
max_layout_work_units=250000. In the extension the number is the setting
hyperMarkdown.diagram.mermaidLayoutLimit, the preview redraws when it
changes, and a diagram over the limit names the setting. The 2-second
render bound is unchanged.

The decision is recorded in issue 0120 and stated in HMD-0034.
@ewiger
ewiger merged commit 1bacb9d into main Nov 29, 2026
15 checks passed
@ewiger
ewiger deleted the fix/mermaid-layout-limit branch November 29, 2026 23:51
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.

1 participant