Skip to content

🐛 fix(detect): drop stale UTF-32 BOM test cases - #967

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix/detect-stale-utf32-cases
Oct 1, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix/detect-stale-utf32-cases

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

#961 and #964 each passed CI on their own base, but they conflict once both are on main. #961 added two cases that decode UTF-32 byte-order-mark input through detect(), and #964 dropped UTF-32 from byte-order-mark detection to follow the WHATWG BOM sniff, which recognizes only the UTF-8 and UTF-16 marks. Those bytes now detect as UTF-16LE and windows-1252, the same as parse(), so the two cases fail on main.

This removes the two stale cases. The UTF-8 and UTF-16 cases in the same parametrization still cover the replacing byte-order-mark codecs, and detect.py has no UTF-32 branch left for them to reach.

Main's macOS jobs also fail the C line gate at 99.9%. #956 added an arena-OOM guard to xsd.h whose body carries GCOVR_EXCL_LINE, but llvm-cov attributes the unexecuted fall-through to the closing brace on its own line, while gcc does not count it, so Linux stays at 100%. The brace now carries the same exclusion conformance.c and schema.c use for this pattern.

closes #968

@gaborbernat gaborbernat added the bug Something isn't working label Oct 1, 2026
@codspeed

codspeed Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 87.39%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 579 untouched benchmarks
⏩ 32 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_feature[conformance-sections-heading] 2.1 ms 1.1 ms +87.39%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing gaborbernat:fix/detect-stale-utf32-cases (e9a9325) with main (6d446a1)

Open in CodSpeed

Footnotes

  1. 32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

llvm-cov attributes the unexecuted fall-through of the arena-OOM guard
added in tox-dev#956 to its closing brace, so every macOS coverage job reports
xsd.h:1369 missed and fails the 100% line gate; gcc does not count the
brace, so Linux stays green. Mark it the way conformance.c and schema.c
mark the same brace.
@gaborbernat
gaborbernat merged commit c91edc1 into tox-dev:main Oct 1, 2026
20 of 50 checks passed
@gaborbernat
gaborbernat deleted the fix/detect-stale-utf32-cases branch October 1, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_detect UTF-32 byte-order-mark cases fail on main

1 participant