Skip to content

fix(unicodedata): mirrored returns int where CPython expects (#712) - #721

Merged
espetro merged 4 commits into
masterfrom
work/712
Oct 27, 2026
Merged

espetro merged 4 commits into
masterfrom
work/712

Conversation

@espetro

@espetro espetro commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

CPython's unicodedata.mirrored() returns an int (0/1), never a bool. The runtime side (ps_unicode_mirrored in ps_unicode.c) already returns int32_t; only the closed-surface table in src/pyscriptc/stdmore.py tagged the return kind as {"kind": "bool"}. That made the differential sweep's text batch diverge from the CPython 3.14 oracle on this row.

Changes

Verification

  • The probe row prints unicodedata.mirrored('('); with the return kind now int, the native binary and the CPython oracle both emit 1.
  • Structural check only: this environment has no network checkout or C toolchain, so the sweep itself could not be executed here. The change is a one-word kind tag mirrored by the existing int32_t C signature.

Stacking note

Depends on #715 (work/difftab586) for the sweep file. #713 and #714 branch off this PR's head.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Deploying pyscriptc with  Cloudflare Pages  Cloudflare Pages

Latest commit: c831ec7
Status:🚫  Build failed.

View logs

@espetro espetro added this to the v0.7.0 milestone Oct 27, 2026
espetro and others added 4 commits October 27, 2026 01:14
CPython's unicodedata.mirrored() returns an int (0/1), not a bool. The
C side (ps_unicode_mirrored) already returns int32_t; only the closed
surface table tagged the return kind as bool, which made the call-table
sweep diverge from the oracle on this row.

Closes #712
… in stdmore table

The previous commit on this branch dropped the mode argument from
os.chmod and the prefix argument from textwrap.indent while transcribing
the table. Restore both so the closed surface matches master plus the
mirrored return-kind fix.
… probe

unicodedata.mirrored now returns the int kind, so the text batch has no
recorded divergence left and the probe passes normally. The
MIRRORED_DIVERGENCE reference and its probe kwarg go away; the #713 and
#714 references stay until those rows are fixed.

Closes #712
@espetro
espetro changed the base branch from work/difftab586 to master October 27, 2026 08:22
@espetro
espetro merged commit 5e283f4 into master Oct 27, 2026
15 of 16 checks passed
@espetro
espetro deleted the work/712 branch October 27, 2026 21:41
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.

fix(unicodedata): mirrored returns bool where CPython 3.14 returns int

1 participant