Skip to content

fix(compile): reuse SQL test artifacts whose bytes are unchanged when only the mtime moved - #1070

Closed
kvlonge wants to merge 1 commit into
mainfrom
fix/sql-test-cache-content-check
Closed

kvlonge wants to merge 1 commit into
mainfrom
fix/sql-test-cache-content-check

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Why

The compiler engine differential intermittently fails on CI because a warm compile misses the SQL-test artifact cache and re-plans its tests (CHI-570). The cache required an exact st_mtime_ns match, so any touch of an unchanged artifact, or a coarse timestamp tick on a slow runner, forced a miss even though the bytes were identical.

Changes

  • Cache records now store a SHA-256 of the artifact contents.
  • Matching size and mtime still reuse the artifact without reading it. When the size matches but the mtime moved, the artifact is reused only if its content digest is unchanged, and the record is refreshed with the new mtime.
  • Cache version bumped from 3 to 4, so older cache files are ignored once and rebuilt.
  • New unit test: an artifact whose mtime moved but whose bytes are unchanged is reused across two writes without re-planning. It fails without this change.
  • No expectations or thresholds changed. The existing tampered-artifact test still re-plans when the bytes differ.

Verification

  • test_compile_target_writer.py (15 passed), compile startup-imports test.
  • ruff format and check, ty on the touched packages, fensu (0 faults), hygiene scan.

@kvlonge
kvlonge enabled auto-merge October 9, 2026 14:28
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@kvlonge

kvlonge commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Held out of the merge queue: two merge-group runs failed the compiler differential on example/waffle-shop compile-store-warm stderr line 11 (CHI-570 flake shape, now at the store-warm step). Not reproducible locally (3/3 example runs pass with this change). Re-queue after #1069 lands so the next failure keeps its evidence.

@kvlonge
kvlonge removed this pull request from the merge queue due to a manual request Oct 9, 2026
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@kvlonge
kvlonge removed this pull request from the merge queue due to a manual request Oct 9, 2026
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@kvlonge
kvlonge removed this pull request from the merge queue due to a manual request Oct 9, 2026
@kvlonge

kvlonge commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Landed together in #1075 to cut merge-queue CI runs; review history stays here.

@kvlonge kvlonge closed this Oct 9, 2026
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