Skip to content

fix: stale weight digest reuse in WeightBuilder cache invalidation#2889

Open
erayack wants to merge 2 commits intoreplicate:mainfrom
erayack:weights-builder-updates
Open

fix: stale weight digest reuse in WeightBuilder cache invalidation#2889
erayack wants to merge 2 commits intoreplicate:mainfrom
erayack:weights-builder-updates

Conversation

@erayack
Copy link
Copy Markdown
Contributor

@erayack erayack commented Mar 30, 2026

Summary

Fix stale weight digest reuse in WeightBuilder cache invalidation.

What changed

  • Added SourceMtimeUnixNano to WeightFile (sourceMtimeUnixNano,omitempty).
  • Cache lookup now matches on name + size + sourceMtimeUnixNano (not just name + size).
  • Lockfile updates now persist sourceMtimeUnixNano with digest/size entries.

Compatibility

  • No lockfile version bump.
  • Existing lockfiles without the new field still load; first rebuild becomes a cache miss and rewrites entry.
  • Older code safely ignores the new JSON field.

Scope

  • Only build-cache correctness path (weights build, weights push, OCI-index build path).
  • No behavior changes in weights inspect, pusher logic, or OCI annotations.

Tests

  • Updated pkg/model/weight_builder_test.go cache tests to cover mtime-aware hit/miss behavior.
  • Verified lockfile entries include the new sourceMtimeUnixNano field.
  • Updated integration harness lockfile fixture shape in integration-tests/harness/harness.go.

@erayack erayack requested a review from a team as a code owner March 30, 2026 15:49
@erayack erayack changed the title Update weights builder and harness behavior fix: stale weight digest reuse in WeightBuilder cache invalidation. Mar 30, 2026
@erayack erayack changed the title fix: stale weight digest reuse in WeightBuilder cache invalidation. fix: stale weight digest reuse in WeightBuilder cache invalidation Apr 3, 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