Skip to content

Tests: a leaner differential for the character-range scan - #151

Merged
mathieu17g merged 1 commit into
mainfrom
charscan-test-diet
Sep 12, 2026
Merged

mathieu17g merged 1 commit into
mainfrom
charscan-test-diet

Conversation

@mathieu17g

@mathieu17g mathieu17g commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

The differential test that #148 added compares the scan with the loop it replaced on every code point, on short byte sequences and on placed cases. It threw about 100,000 exceptions per run, and a throw costs a backtrace: about 10 s of the suite on my machine, and about 30 s on the Linux runners (152 s to 184 s). The macOS aarch64 job varies from 109 s to 411 s from one run to the next, with or without these tests, so its time says nothing here.

The reference loop now returns its verdict instead of throwing it, with Base.ismalformed and Base.isoverlong as the test UInt32(c) applies before it throws; the four-byte sequences come from an eight-byte alphabet and the placed cases from the twenty single bytes and the eighteen curated cases. Every code point, both SubString paths and the StringView case stay. The block runs in 4.5 s instead of 18 s on my machine, and the suite in 54 s instead of 72 s; the Linux jobs are back to 139 s and 97 s.

The reference loop now returns its verdict instead of throwing it,
malformed and overlong sequences told by `ismalformed`/`isoverlong`,
the test of `UInt32(c)`; the four-byte sequences come from eight bytes
and the placed cases from the single bytes and the curated cases. A
throw costs a backtrace: the block goes from 18 s to 4.5 s here, the
suite from 72 s to 54 s.

Assisted-by: Claude (Anthropic)
@codecov-commenter

codecov-commenter commented Sep 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.67%. Comparing base (a78327e) to head (103f8ef).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #151   +/-   ##
=======================================
  Coverage   96.67%   96.67%           
=======================================
  Files          15       15           
  Lines        2649     2649           
=======================================
  Hits         2561     2561           
  Misses         88       88           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mathieu17g
mathieu17g marked this pull request as ready for review September 12, 2026 09:55
@mathieu17g
mathieu17g merged commit 1681e21 into main Sep 12, 2026
13 checks passed
@mathieu17g
mathieu17g deleted the charscan-test-diet branch September 12, 2026 09:56
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