Skip to content

PORT-0: Chrome port registry (docs/ports.json), its test, and generated THIRD_PARTY_NOTICES.md - #52

Merged
thejackshelton merged 21 commits into
masterfrom
port-0-registry
Oct 1, 2026
Merged

thejackshelton merged 21 commits into
masterfrom
port-0-registry

Conversation

@thejackshelton

@thejackshelton thejackshelton commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PORT-0 (T118): the Chrome port registry, per docs/decisions.md "Porting Chrome's algorithms" and the T118J LGPL ruling.

What changed

  • docs/ports.json is a registry of every Chrome source file Dragon cites. Each entry has:

    • the path at tag 145.0.7632.6;
    • the licence kind and copyright;
    • the file and header sha256;
    • the line ranges;
    • the Dragon file and declaration;
    • whether it is a port or reference use.

    docs/ports.md describes the registry.

  • packages/parity/test/chrome-ports.test.ts checks the registry on every pnpm test. It fails when:

    • a source file cites an unregistered .cc, .cpp or .h file;
    • an LGPL entry has no ruling;
    • an LGPL entry is used as a port without being on the T123 clean-room list (step_range.cc/.h, text_break_iterator.cc);
    • a proof test is missing;
    • a Dragon file or declaration has gone;
    • a required notice is missing from the porting file;
    • THIRD_PARTY_NOTICES.md is stale.
  • THIRD_PARTY_NOTICES.md is generated by pnpm notices:gen, is listed in .macroscope/ignore.md, and ships in the dragon package. The generator refuses a registry that is missing its tag, skiaRevision or v8Revision, and a test covers that.

  • Re-cites: the T118J class A citations are reworded, comments only, to cite the spec or a Chrome observation.

  • Two citations added since the branch was cut:

    • computed_style_constants.h (the 10000px font-size cap in units.ts). It is LGPL, class A, reference use only, like CSS_LENGTH_MAX. There is no Chrome golden yet.
    • v8/src/base/ieee754.cc (the rt harness sin and cos). This is fdlibm code under Sun's notice. The registry pins the V8 revision 4e031e4b6bfa from Chrome's DEPS file, adds the v8/ root and the fdlibm-sun licence kind, and keeps the notice in harness.ts.

What passed

  • pnpm typecheck.
  • pnpm test: 3037/3039. The two failures were 120000 ms timeouts under load (lanes.test.ts iosLayoutProjection, native-compare.test.ts reference proof), and both pass on rerun (41/41).
  • pnpm run parity:devices: every lane status equals origin/master's. device-pixels fails with 135 iOS and 182 Android failures, as on master. out/device-failures-{ios,android}.json are byte-identical to origin/master's.

Changed tests and checks, and why

  • chrome-ports.test.ts pins 19 LGPL entries, up from 18, because of the new class A entry computed_style_constants.h.
  • The rapidhash notice test also covers the fdlibm notice.
  • New checks reject a wrong v8Revision, and a registry missing its tag, skiaRevision or v8Revision.
  • dist.test.ts expects THIRD_PARTY_NOTICES.md in the packed tarball.

No tolerance is loosened and no check is removed.

🤖 Generated with Claude Code

Note

Add Chrome port registry (docs/ports.json), parity test, and generated THIRD_PARTY_NOTICES.md

  • Adds the Chrome-port registry at ports.json, recording upstream source locations, revisions, licences, hashes, and the Dragon files that cite each source entry. Documents the schema and workflow in ports.md.
  • Adds a large offline Vitest suite in chrome-ports.test.ts that validates registry coverage, licence rulings, proof references, citation scanning, and generated notices against repository state.
  • Adds gen-third-party-notices.ts, runnable via npm run notices:gen, which builds THIRD_PARTY_NOTICES.md from the registry plus vendor/harfbuzz/COPYING. The dragon package prepack copies the notices into the published tarball, and dist.test.ts enforces this.
  • Updates ported-source JSDoc across fonts, units, and images modules to cite Chrome/Blink upstream behavior, and adds the rapidhash BSD-2-Clause and fdlibm/Sun licence notices.
  • Risk: parity tests now fail on missing citations, unclassified files, invalid proof references, or a stale THIRD_PARTY_NOTICES.md; noticeTextOf throws when a non-LGPL registry entry lacks a licence-text identifier.

Macroscope summarized 56f438e.

docs/ports.json lists the 99 Chrome files Dragon cites at 145.0.7632.6
(Skia at DEPS revision 2ab8add5): upstream path, licence header kind and
phrase, copyright, sha256 of file and header, line ranges, and each citing
Dragon file and declaration. packages/parity/test/chrome-ports.test.ts
fails on an unlisted citation, an LGPL entry not on the named
pending-ruling list, or a Dragon file/declaration that is gone.
18 cited files carry LGPL headers; the code is unchanged and they are
listed for a PM ruling.
…ist for T123, third-party notices

- docs/ports.json: each LGPL entry carries its T118J ruling (class, basis, proof
  tests); class A uses become references. KNOWN_LGPL_CLEAN_ROOM (step_range.cc,
  step_range.h, text_break_iterator.cc, tied to T123) replaces the pending list.
  The ASCII line-break table is re-cited to BSD character_property_data_generator.cc
  433-470 (class C). css_primitive_value.h notes the LGPL css_resolution_units.h /
  resolution_units.h and css-values-4 6.2. rapidhash gains an attribution; math.ts
  (merged from master) is listed under css_math_expression_node.cc.
- licenceTexts in ports.json; THIRD_PARTY_NOTICES.md written by
  scripts/gen-third-party-notices.ts (pnpm notices:gen); chrome-ports.test.ts
  fails when it differs, when a proof file is missing, or when an LGPL entry
  other than the clean-room three has a port use. The dragon package ships the
  notices (prepack + files; dist.test.ts expects it).
- Comment-only rewording to reference style in family-list.ts, css/units.ts,
  layout units.ts, button-inner.ts, appearance.ts, natural-size.ts, wtf-hash.ts
  (plus the rapidhash notice) and linebreak.ts (ASCII table cite).
…s edits

Command: pnpm native:gen (only source sha256 headers and ts: line references move).
…output (scripts/gen-third-party-notices.ts), with a test that review skips it and reads the registry
…r: pnpm run parity:lanes --run-host (device lanes not run)

The regeneration sequence (grammar:gen, ua:capture, parity:capture and profile:rows to the fixed point, parity:dpr-capture, layout:vectors, layout:dpr-vectors, layout:break-vectors, parity:break-capture, parity:pixel-capture, native:gen, north-star check.ts, tw:sweep, wpt:run and wpt:update-expectations --target web, parity:glyph-b3 --write-bottom-pins, media-sweep and --check 18/18, notices:gen) changed no other file.
…rom master; regenerated in the next commits)
…gen; only source sha256 headers and ts: line references move). pnpm notices:gen left THIRD_PARTY_NOTICES.md unchanged.
… branch was cut. computed_style_constants.h (V2a's MAX_FONT_SIZE, LGPL) gets a class A ruling like CSS_LENGTH_MAX (no Chrome golden yet). V8's src/base/ieee754.cc (ANIM-a2's rt harness sin/cos, fdlibm under the Sun notice) is a port: the registry pins the DEPS v8Revision, adds the v8/ root and the fdlibm-sun licence kind, and the test requires the Sun notice in harness.ts like rapidhash's in wtf-hash.ts. The notices generator refuses a registry without tag, skiaRevision or v8Revision. The LGPL count pin moves 18 -> 19 for the new class A entry.
…CES.md: V8 revision and the fdlibm-sun section) and pnpm native:gen (Harness.swift/Harness.kt: source sha256 headers and ts: line references only)
…h-up: /tmp/device-lease.sh pnpm run parity:devices (every lane status as on origin/master; device-pixels fail 135 iOS / 182 Android as on master; out/device-failures-{ios,android}.json byte-identical to origin/master)
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR mostly adds an offline Chrome-port registry, license-notice generation, tests, and package distribution metadata, with no substantive production algorithm changes. It also changes .macroscope/ignore.md, which controls review behavior and requires human review.

You can add or adjust custom eligibility rules. Learn more.

…/.cts with JSX text, hand-written .d.ts, Zig, C-family, .tsrx, module maps, shell; .mm citable) and fails on a tracked file that is neither scanned code nor known data (Macroscope 4157230091); a file porting a bsd-other or fdlibm-sun entry must keep every paragraph of its licence text, not only the copyright line (4157230100); notChrome exempts only the exact cited paths (4157230103). The wider scan found dragon_hb.zig citing three Blink font files (now listed as port uses) and notChrome paths for ICU, JNI, HarfBuzz and dragon_hb.h. The notices generator refuses an entry without an upstream path. Tests fail without each fix; THIRD_PARTY_NOTICES.md unchanged (pnpm notices:gen).
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
…ted paths, so the scan excludes it on Windows too; a test pins that the excluded path is a tracked file (Macroscope 4157569784)
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
…r before it (a URL's '//' may precede it) and none after it (a sentence-final '.' is allowed), so foo.h.bak, foo.h/old and foo.h-old cite nothing; a table test fails on the old pattern (Macroscope 4157639810)
…r; regenerated by the device run in a later commit)
…wift/Kotlin triple-quoted strings, Zig \\ line strings and C #include <...> paths (it missed all three; tests fail on the old scan), and a malformed notChrome cited (not a list) never exempts by substring. The wider scan lists dragon_hb.h's <stdint.h> under notChrome.
…in/master: /tmp/device-lease.sh pnpm run parity:devices (stale before: the app stamp moved because Harness.swift/Harness.kt carry harness.ts's sha256, changed by the fdlibm notice comment; every lane status as on origin/master, device-pixels 135 iOS / 182 Android as on master; out/device-failures-{ios,android}.json byte-identical to origin/master)
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
Comment thread packages/parity/test/chrome-ports.test.ts Outdated
… a nested name of the same spelling no longer keeps a removed port alive (Macroscope 4158215891); non-script code is read by a lexer, so Kotlin and Swift nested block comments are scanned to their matching close, unterminated spans run to the end, shell strings span lines and .zon uses // comments (4158215899); a notChrome path under a Chromium source root, or naming any registry entry (citedAs included), is refused (4158215912). Re-audit of the whole file: TypeScript comments are read at every token (a comment before '}', in empty JSX braces or at the end of a file was missed), Markless .tsrx and module maps are read whole (free text between tags was missed), and a code file in a skipped directory must say it is generated. Each fix has a test that fails on the old code.
@thejackshelton
thejackshelton merged commit ed0099c into master Oct 1, 2026
4 checks passed
thejackshelton added a commit that referenced this pull request Oct 1, 2026
…plit: no source conflict; lanes.json taken from master, regenerated by the device run next
thejackshelton added a commit that referenced this pull request Oct 1, 2026
… buildItem (the flex-shrink 0 shortcut, lines 1078-1084) and columnIntrinsicBlockSize (IntrinsicBlockSize, 914-923 and 1117-1120), now that PORT-0 (#52) is in the base; chrome-ports.test.ts 13/13
thejackshelton added a commit that referenced this pull request Oct 2, 2026
 now in the base): css_math_function_value.cc lists packages/layout/test/calc.test.ts as a reference; new entry platform/wtf/math_extras.h (bsd-apple, header-bsd-2, tag 145.0.7632.6 sha256 c71bc62c..., lines 133-139 RoundHalfTowardsPositiveInfinity) referenced by calc.test.ts. THIRD_PARTY_NOTICES.md is rebuilt by pnpm regen next
thejackshelton added a commit that referenced this pull request Oct 2, 2026
…the catch-up): block_layout_algorithm.cc gains block.ts blockLevelInlineSize as a port with the cited ranges 3283-3304, 2799-2804, 2054-2169 and 197-213; new entry core/layout/geometry/writing_mode_converter.cc (bsd-chromium, tag 145.0.7632.6 sha256 abb678e7..., lines 71-79 SlowToPhysical). THIRD_PARTY_NOTICES.md is rebuilt by pnpm regen next
thejackshelton added a commit that referenced this pull request Oct 2, 2026
…ter the catch-up), all cited by rt-hit.ts's header: box_fragment_painter.cc (port; NodeAtPoint, HitTestAllPhases, HitTestTextItem, HitTestLineBoxFragment, HitTestBlockChildren, HitTestItemsChildren, HitTestClippedOutByBorder located), fragment_item.cc gains rt-hit.ts (port), clip_rect.cc Intersects (port, bsd-apple, new licence text header-bsd-9 with 'APPLE INC.'), ui/gfx/geometry/quad_f.cc IntersectsRect (port); contoured_border_geometry.cc, contoured_rect.cc and float_rounded_rect.cc (bsd-other, new licence text adobe-bsd-2) as references: the path to quad IntersectsRect, radii refused; hit_test_location.cc and paint_layer.cc (LGPL) as whole-file references with class A rulings (Chrome observation; proof rt-hit.test.ts and hit-report.test.ts). chrome-ports.test.ts: the LGPL count 19 -> 21 (the two new class A entries; intent kept: an exact count), and the bsd-other notice check picks the bsd-other entry that ports code (adobe-bsd-2 is only referenced, so the first bsd-other entry no longer has a port use). gen-third-party-notices.ts titles adobe-bsd-2. THIRD_PARTY_NOTICES.md is rebuilt by pnpm regen next
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.

1 participant