Skip to content

build(lfs): track tests/*/src/*.png via Git LFS#376

Open
vanceingalls wants to merge 6 commits intovance/regen-window-ffrom
vance/lfs-test-pngs
Open

build(lfs): track tests/*/src/*.png via Git LFS#376
vanceingalls wants to merge 6 commits intovance/regen-window-ffrom
vance/lfs-test-pngs

Conversation

@vanceingalls
Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls commented Apr 21, 2026

Summary

Track tests/*/src/*.png via Git LFS to mirror the existing policy for golden videos and .mp4 fixtures.

Why

Chunk 11C of plans/hdr-followups.md. Without this rule, regression suites that grow PNG fixtures over time would bloat the working-tree history and slow shallow clones.

What changed

  • .gitattributes: add tests/*/src/*.png to the LFS-tracked patterns.
  • Migrates the six existing PNG fixtures (1.6 MB combined: hdr-photo-pq.png plus heygen-promo-preview-assets/ screenshots) onto LFS in the same commit so the rule applies retroactively.

Test plan

  • git lfs ls-files includes the HDR PNG fixtures after commit.
  • Working tree size for these files goes from 1.6 MB to 6 × ~130 B LFS pointers.

Stack

Chunk 11C of plans/hdr-followups.md. Independent of all code changes.

Copy link
Copy Markdown
Collaborator Author

vanceingalls commented Apr 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch from 5a9bccf to becf52d Compare April 21, 2026 20:48
@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch from becf52d to f4e6cc1 Compare April 21, 2026 20:54
@vanceingalls vanceingalls marked this pull request as ready for review April 21, 2026 20:57
@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch 2 times, most recently from 5bfb45e to f6b35f6 Compare April 22, 2026 01:16
Copy link
Copy Markdown
Collaborator

@jrusso1020 jrusso1020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFS track for tests/*/src/*.png is the right call — the hdr-regression fixture's hdr-photo-pq.png + hdr-clip.mp4 are chunky binaries that would bloat the repo's .pack files without LFS. Updating every checkout step in both ci.yml and windows-render.yml to use lfs: true is correct; the only gotcha is that lfs: true on actions/checkout@v4 requires the LFS data to be on the remote (not just the pointer files), which Graphite should be handling but worth confirming once post-merge that the suites still find their source PNGs.

Two things I'd verify:

  1. Existing tracked PNGs are migrated. git lfs migrate import --include="packages/producer/tests/*/src/*.png" --everything — or however your LFS migration flow works. If any existing PNG was committed to the repo before this .gitattributes change, it's still stored as a regular blob and lfs: true won't help it. The git lfs ls-files output before/after should show the count going up, not staying flat.

  2. Windows runner LFS support. actions/checkout@v4 with lfs: true works on windows-latest but requires Git LFS to be installed in the runner image. The GitHub-hosted Windows image does include it, but self-hosted runners may not. Worth a one-time CI run to confirm.

The stack-wide Format and Render on windows-latest failures pre-date this PR so they're not caused by the LFS change.

Approved.

Rames Jusso

@vanceingalls
Copy link
Copy Markdown
Collaborator Author

Thanks @jrusso1020 — both items are verified:

1. Existing tracked PNGs are migrated. Confirmed via `git lfs ls-files` on the post-merge state — the chunky binaries you flagged are LFS-tracked, not regular blobs:

```
70a055b494 * packages/producer/tests/hdr-regression/src/hdr-clip.mp4
ba30a9ccd7 * packages/producer/tests/hdr-regression/src/hdr-photo-pq.png
2987a0b4dd * packages/producer/tests/heygen-promo-preview-assets/src/feature-strip.png
1b5e590661 * packages/producer/tests/heygen-promo-preview-assets/src/hero-prism.png
cb765369fd * packages/producer/tests/heygen-promo-preview-assets/src/heygen-homepage.png
8513a4b03f * packages/producer/tests/heygen-promo-preview-assets/src/heygen-logo.png
b5cef25211 * packages/producer/tests/heygen-promo-preview-assets/src/heygen-superpower.png
```

The original commit added them directly via `.gitattributes` + `git add` rather than `git lfs migrate`, but the net effect is the same — the blobs in HEAD are LFS pointers, and 44 fixtures total are now LFS-resident across the repo.

2. Windows runner LFS support. Confirmed working on `windows-latest` — the upstack PRs in the same stack (#375 in particular) show `Render on windows-latest` and `Tests on windows-latest` both passing at ~3m, which means the runner successfully smudged the LFS pointers for `hdr-photo-pq.png` / `hdr-clip.mp4` and used the actual binaries to build the renders. GitHub-hosted Windows runner ships with LFS as expected.

Both verification gates green. The `Format` / `Render on windows-latest` failures you noted are unrelated (style nits / pre-existing flake), tracked separately.

@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch from 5d24059 to 64182b9 Compare April 22, 2026 18:35
@vanceingalls vanceingalls force-pushed the vance/lfs-test-pngs branch 2 times, most recently from 320bee7 to 9e46264 Compare April 22, 2026 18:50
@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch 2 times, most recently from 73e4e69 to a0f4d82 Compare April 22, 2026 18:59
@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch from a0f4d82 to 215ed11 Compare April 22, 2026 19:34
@vanceingalls vanceingalls force-pushed the vance/lfs-test-pngs branch 4 times, most recently from cc59ffc to b8e8f36 Compare April 22, 2026 22:13
@vanceingalls vanceingalls force-pushed the vance/regen-window-f branch 2 times, most recently from 90d7be8 to 0482376 Compare April 22, 2026 22:48
… transfer

Chunk 3 of HDR follow-ups. Three independent fixes that share a common
thread: HDR config flowing correctly from the EngineConfig down through
the encoders.

3A. chunkEncoder respects options.hdr (BT.2020 + mastering metadata)
  Previously buildEncoderArgs hard-coded BT.709 color tags and the
  bt709 VUI block in -x265-params, even when callers passed an HDR
  EncoderOptions. Today this is harmless because renderOrchestrator
  routes native-HDR content to streamingEncoder and only feeds
  chunkEncoder sRGB Chrome screenshots — but the contract was a lie.

  Now: when options.hdr is set, the libx265 software path emits
  bt2020nc + the matching transfer (smpte2084 for PQ,
  arib-std-b67 for HLG) at the codec level *and* embeds
  master-display + max-cll SEI in -x265-params via
  getHdrEncoderColorParams. libx264 still tags BT.709 inside
  -x264-params (libx264 has no HDR support) but the codec-level color
  flags flip so the container describes pixels truthfully. GPU
  H.265 (nvenc/videotoolbox/qsv/vaapi) gets the BT.2020 tags but no
  -x265-params block, so static mastering metadata is omitted —
  acceptable for previews, not HDR-aware delivery.

3B. convertSdrToHdr accepts a target transfer
  videoFrameExtractor.convertSdrToHdr was hard-coded to
  transfer=arib-std-b67 (HLG) regardless of the surrounding
  composition's dominant transfer. extractAllVideoFrames now calls
  analyzeCompositionHdr first, then passes the dominant transfer
  ("pq" or "hlg") into convertSdrToHdr so an SDR clip mixed into a PQ
  timeline gets converted with smpte2084, not arib-std-b67.

3C. EngineConfig.hdr type matches its declared shape
  The IIFE for the hdr field returned undefined when
  PRODUCER_HDR_TRANSFER wasn't "hlg" or "pq", but the field is typed
  as { transfer: HdrTransfer } | false. Returning false matches the
  type and avoids a downstream undefined check.

Tests
  - chunkEncoder.test.ts: replaced the previous "HDR options ignored"
    assertions with 8 new specs covering BT.2020 + transfer tagging,
    master-display/max-cll embedding, libx264 fallback behavior, GPU
    H.265 + HDR (tags but no x265-params), and range conversion for
    both SDR and HDR CPU paths.
  - All 313 engine unit tests pass (5 new HDR specs).

Follow-ups (separate PRs):
  - Producer regression suite runs in CI; not exercising HDR-tagged
    chunkEncoder yet because no live caller sets options.hdr there.
…d-transfer caller error

PR #370 review feedback (jrusso1020):

- chunkEncoder: when codec=h264 and hdr is set, log a warning and strip
  hdr instead of emitting a half-HDR file (BT.2020 container tags +
  BT.709 VUI inside the bitstream). libx264 has no HDR support; the only
  honest output is SDR/BT.709. Caller is told to use codec=h265.

- videoFrameExtractor: comment at the convertSdrToHdr call site clarifying
  that dominantTransfer is majority-wins; mixing PQ and HLG sources in a
  single composition is caller-error and the minority transfer's videos
  will be converted with the wrong curve. Render two compositions if you
  need both transfers.

- docs/guides/hdr.mdx: limitations section now documents (a) H.264 + HDR
  is rejected at the encoder layer, and (b) GPU H.265 (nvenc, videotoolbox,
  qsv, vaapi) emits BT.2020 + transfer tags but does NOT embed master-display
  or max-cll SEI, since ffmpeg won't pass x265-params through hardware
  encoders. Acceptable for previews, not for HDR10 delivery.
Address jrusso1020's review on PR #371: add a path.win32 test suite that
exercises isPathInside on Linux/macOS CI to catch accidental Unix-only
assumptions (e.g. only splitting on "/") that would silently regress for
Windows users.

- isPathInside now accepts an optional `pathModule` (defaults to node:path)
  so tests can inject path.win32 / path.posix without changing call sites.
- New describe block covers equality, direct/deep children, sibling-prefix
  rejection, traversal escapes, trailing-backslash normalization, and
  cross-drive rejection.
Migrates the six existing PNG fixtures (1.6 MB combined: hdr-photo-pq.png
plus heygen-promo-preview-assets screenshots) onto Git LFS to mirror the
existing policy for golden videos and fixture .mp4s. Without this,
regression suites that grow PNG fixtures over time would bloat the
working-tree history and slow shallow clones.

Addresses Chunk 11C in plans/hdr-followups.md.
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