Skip to content

build(labels): bump demangle to 0.6.0, take #383 review nits - #387

Merged
danielplohmann merged 3 commits into
danielplohmann:masterfrom
r0ny123:build/demangle-0.6.0
Oct 14, 2026
Merged

danielplohmann merged 3 commits into
danielplohmann:masterfrom
r0ny123:build/demangle-0.6.0

Conversation

@r0ny123

@r0ny123 r0ny123 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #383, which merged before these were pushed.

Before: smda pins demangle==0.5.1. The pin comment does not say what a host application in the same process can still do, and the #379 CHANGELOG entry has no PR links, a vaguer module reference and a cost figure without its baseline.

After: smda pins demangle==0.6.0. The pin comment notes that a host calling load_plugins() or register_language() can still replace a built-in scheme, leaving Itanium, MSVC and Swift names mangled without an error. The CHANGELOG entry links (#379, #383), names the four modules, and states the cost against the native build, marked as measured on 0.5.0.

0.6.0 does change schemes/ (MSVC operator<=>, ARM64e qualifiers, Swift ~Deinitable, and the 0.5.2 bounds fixes for oversized Rust lengths and non-ASCII Swift identifiers). Every name the test suite passes to demangle, 20,430 of them, gives the same output and the same exceptions on 0.5.1 and 0.6.0. Entry points are still read only in load_plugins(), testDemangleSchemes passes, and there are no new dependencies.

Full suite: 2,244 passed, 2 skipped. ruff, ruff format and ty are clean.

… nits

0.6.0 keeps entry points behind load_plugins() and returns the same
output as 0.5.1 for all 20,430 names the test suite passes it.

The pin comment notes that a host calling load_plugins() or
register_language() itself can still replace a scheme. The CHANGELOG
entry names the four modules again, restores the native-build baseline
for the cost figure and links danielplohmann#379 and danielplohmann#383.

@danielplohmann danielplohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The bump itself is fine. I diffed the 0.5.1, 0.5.2 and 0.6.0 wheels. Entry points are still read only in load_plugins(). There are no new dependencies and no subprocess or network calls. On smda's inputs:

  • Fixtures: 8,282 function labels from 46 analysed fixtures, 0 changed.
  • Replay: all 22,321 distinct (scheme, name) pairs from two suite runs plus the fixtures give the same result on both versions.
  • Fuzzing: about 8,950 mutated and pathological names, with no crash or timeout. The slowest name drops from 0.22 s to 0.033 s.

What needs changing is how the bump is described, because 0.6.0 does change labels, just not on our fixtures:

  • Itanium and Swift (0.5.2): source-name lengths count UTF-8 bytes instead of characters. _ZN4main5caféE now reads as main::café where it was refused, _Z4cafév is now refused, and $s4main5caféV1fyyF reads as main.café.f() -> () instead of garbage. That's correct, since GCC/Clang mangle byte lengths, but non-ASCII C++/Swift names get new labels.
  • MSVC ARM64e __ptrauth (0.6.0): new grammar; these names used to be refused.
  • Swift ~Deinitable is now rendered by name.
  • Rust: bounds checks and a faster path for oversized lengths, with no output difference found.
  • MSVC operator<=>: no change. _DOUBLE_UNDERSCORE_OPERATORS is identical in 0.5.1 and 0.6.0, so please drop that from the description.

So:

  1. CHANGELOG: please restore #379's bullet (pin aside) and give this bump its own (labels) bullet, under Changed or Compatibility since labels move on binaries with non-ASCII or ARM64e names. Name the changes above and the measurement: "8,282 fixture labels, 0 changed, reproduced by reviewer; no fixture name is non-ASCII". As written, #379's "every Itanium, MSVC and Rust label is unchanged" was measured on 0.5.0 and no longer holds. Please also drop the 20,430: Hypothesis draws new names every run (19,014 and 19,015 on two runs, 15,709 shared), so the count can't be reproduced. Then link (#387).
  2. Pin comment (pyproject.toml): a replacing plugin that parses would silently change labels, not leave them mangled. Something like "can replace a built-in scheme and change or drop Itanium, MSVC and Swift labels without an error".

Upstream nits, not for this PR: __ptrauth data symbols render without a space before the name (int *__ptrauth(2, 3, 1)p), and ptrauthNumber accepts any number of nibbles and wraps at 64 bits.

With the CHANGELOG fixed, this can go into 4.10.0.

@danielplohmann danielplohmann added this to the v4.10.0 milestone Oct 14, 2026
0.6.0 moves labels on non-ASCII Itanium and Swift names and on ARM64e
MSVC names, none of which the fixtures contain. The danielplohmann#379 entry goes
back to describing the 0.5.1 pin it was measured on, and the bump gets
its own bullet naming those changes. The pin comment now says a
replacing plugin can change labels, not only leave them mangled.

@danielplohmann danielplohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Changelog, pin comment and the separate 0.6.0 entry all read right now. Approving for 4.10.0.

@danielplohmann
danielplohmann merged commit 9a2a3a1 into danielplohmann:master Oct 14, 2026
23 checks passed
@r0ny123
r0ny123 deleted the build/demangle-0.6.0 branch October 15, 2026 12:48
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