M+Minify++

Conformance ยท independent corpora and browser semantics

Independent evidence beyond hand-written fixtures.

Separate Minify++ conformance repositories exercise CSS and HTML from Web Platform Tests and JavaScript from Test262. Each suite pins its upstream revision, records explicit exclusions and compares the original and transformed input through an independent semantic oracle.

31,155WPT-derived cases in the final full corpus
31,155cases passing the corrected Chromium oracle
17earlier cases exposing real Minify++ defect families
0final differences, errors, rejections or unverified cases
Final result: 31,155 / 31,155 passing.

After repairing Minify++ and strengthening the oracle to cover descriptor-bearing rules, @import and @charset, the complete corpus passed with zero CSSOM differences, minification errors, browser rejections, source rejections or unverified cases.

HTML: 9,651 / 9,651 eligible documents

At WPT revision aed18189e54793ee12286eb96509e87df27f52dd, the HTML suite extracted 9,651 eligible UTF-8 documents. Every transformed document produced the same retained DOM projection as its source, with zero DOM differences, minifier errors or oracle errors.

Eligibility is intentionally explicit: 588 support or template-path files, 240 unresolved server/generator templates and 28 non-UTF-8 inputs were excluded and counted. The audit initially retained 14 DOM differences. Triage found real Minify++ boundary and preservation defects rather than dismissing them; fixes now cover recoverable attribute quotes, unquoted-value boundaries, malformed raw-text openers, inline white-space preservation, raw-text elements, foreign SVG/MathML subtrees, EOF comments and tag whitespace. Each repaired family is retained in the standalone regression suite.

JavaScript: 39,741 / 39,741 runtime-applicable programs

At Test262 revision 419d3e0a2273ba01a3bfcbec423f2801425b8e93, 48,011 tests met the source-selection contract. Of those, 39,741 could execute in the selected Node runtime and all 39,741 produced equivalent observable behavior after minification. The remaining 8,270 are recorded as runtime-inapplicable, dominated by unsupported Temporal coverage; they are not reported as passes.

The earlier 239 source/runtime incompatibilities drove a metadata and runtime audit. The harness now parses Test262 YAML metadata, implements the required async and $262 hooks, classifies unsupported feature families and host constraints, isolates process failures in bounded batches, and supports deterministic shards. That work also exposed and repaired Minify++ defects involving nested template literals, Unicode line separators in removed comments and regular-expression boundaries after identifier keywords.

JSX/TSX: 221 / 221 eligible programs

At TypeScript revision 1e4744d68260a7cb91b62b12edc3f6a2187faaf1, all 221 eligible virtual JSX/TSX programs preserve the pinned TypeScript parser's exact non-trivia token stream. Fifty-six parser-negative or otherwise source-rejected virtual programs are counted outside the denominator. The campaign repaired JSX-root detection and ASI-significant boundaries in Minify++.

JSON: 93 / 93 eligible documents

At JSONTestSuite revision 1ef36fa01286573e846ac449e8683f8833c5b26a, all 93 valid unique-key parsing fixtures preserve a lossless decimal-backed JSON data model. The extractor separately counts 223 invalid or implementation-defined cases and two duplicate-key cases rather than allowing last-key-wins parsing to hide a change.

XML: 535 / 535 eligible documents

Against the SHA-256-pinned W3C XML Conformance Test Suite archive, all 535 strict standalone UTF-8 documents preserve a namespace-aware canonical tree. The denominator deliberately excludes 2,176 doctype/entity-dependent cases, 91 non-UTF-8 inputs and 256 source-rejected negative or unsupported cases. Comments are removable trivia; elements, namespaces, attributes, text and processing instructions are compared.

SVG: 1,176 / 1,176 eligible documents

At WPT revision aed18189e54793ee12286eb96509e87df27f52dd, all 1,176 eligible standalone SVG documents preserve the strict XML structural projection. Thirty-nine server-substituted or tentative fixtures, 37 support/resource fixtures and six parser-inapplicable documents are explicitly excluded. This is structural evidence, not a claim of pixel-identical browser rendering.

How the audit reached the final result

The first strengthened full snapshot contained 31,137 extracted cases. It produced 30,579 structured passes and 558 diagnostics. Triage showed that 17 cases represented browser-relevant Minify++ defects, two came from UTF-16 extraction errors in the harness, and 539 reduced to verified lexical-trivia differences.

Those findings drove repairs to selector boundaries, escaped identifiers, malformed-declaration recovery and bad-string handling. A subsequent adversarial review also found that the oracle did not inspect descriptors such as @counter-style, allowing a CSS hex-escape whitespace defect to compare as passing. The oracle and implementation were corrected, extraction produced 31,155 cases, and the entire corpus was rerun at WPT revision a53926ac643a.

What the harness actually checks

Each source and minified stylesheet is parsed in Chromium. The structured view records rule types, selectors and conditions, declarations, priorities, child rules and exposed descriptor fields. Selectors remain exact because whitespace can be a descendant combinator. Values and conditional preludes use a conservative lexical canonicalizer that removes only trivia proven not to change token boundaries.

Raw CSSOM serialization is retained for every non-pass. Diagnostic differences are therefore inspectable rather than silently normalized away.

Defects the corpus found

  • Native-nesting descendant selector whitespace around &.
  • Attribute-selector namespace whitespace that changed invalid selectors into valid ones.
  • Escaped whitespace in ::part() identifiers.
  • Invalid declaration values joined into different browser-accepted constructs.
  • Bad-string newline trimming that changed CSS error recovery.

Those families were repaired in Minify++ and converted into small permanent regressions in the main repository. The corpus also found two UTF-16 decoding defects in the extractor itself, which were fixed separately rather than misreported as product failures. The final complete run confirms that the corrected implementation satisfies the strengthened oracle across all 31,155 extracted cases.

Why this is stronger than idempotence

Running a minifier twice can prove that its output is stable, but consistently wrong output can also be stable. The browser-backed comparison asks whether Chromium sees the same selectors, rules and declarations before and after transformation.

One corpus, more than one minifier

The same extracted cases and Chromium oracle can run against Lightning CSS. Its adapter uses bounded multi-input batches and recursively isolates unsupported fixtures, making comparison possible without changing the corpus or pass criteria. The comparison infrastructure exists; this page does not claim a head-to-head result until one is recorded and reviewed.

Reproduce the lab

git clone https://github.com/minify-cx/minify-css-conformance.git
cd minify-css-conformance
python3 tools/conformance.py sync wpt
python3 tools/conformance.py extract-css
python3 tools/conformance.py run-css --cases work/wpt-css.jsonl

The standards suites stay upstream and are pinned by exact revision. Result JSON records the source revision, tool identity and raw evidence needed to audit disagreements.