Record per-file mtimes in .kati_stamp for accurate regen detection - #310
Merged
Merged
Conversation
jihoonkang0829
force-pushed
the
fix-kati-stamp-mtime
branch
2 times, most recently
from
September 18, 2026 17:16
e1bfb54 to
b81ee57
Compare
Collaborator
|
Could you add a test? |
jihoonkang0829
force-pushed
the
fix-kati-stamp-mtime
branch
from
September 18, 2026 17:51
b81ee57 to
6a67832
Compare
Contributor
Author
|
Added |
Colecf
reviewed
Sep 18, 2026
| # Set mtime to a future timestamp (later than Kati's process start time). | ||
| # Previously, Kati compared file mtime against the generation start time, | ||
| # falsely marking files with mtime > gen_time as modified on subsequent runs. | ||
| touch -d "2030-01-01 00:00:00" dep.mk extra.txt |
Collaborator
There was a problem hiding this comment.
Could you do dates in like 2050 or later? I could see these tests breaking / becoming ineffective in 4 years.
Contributor
Author
There was a problem hiding this comment.
Updated the timestamp.
Previously, Kati recorded a single process start time (gen_time) in .kati_stamp and compared every makefile and extra file dependency against it during --regen check. This caused false invalidations in two common scenarios: 1. Virtual or on-demand filesystems where uncached source files are materialized on first read during evaluation, assigning them an mtime of TimeNow() which is later than Kati's start time. 2. Build-generated intermediate staging files written during Make evaluation with an mtime later than Kati's start time. On subsequent builds, Kati would see file.mtime > gen_time and falsely conclude that the files were modified, triggering unnecessary full reanalysis. This change stores each file's observed mtime alongside its path in .kati_stamp (both in ckati and rkati). During --regen, each file's current mtime is compared against its recorded mtime. If the file's mtime has not advanced, it is recognized as clean.
jihoonkang0829
force-pushed
the
fix-kati-stamp-mtime
branch
from
September 18, 2026 20:05
6a67832 to
22dcd95
Compare
Colecf
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, Kati recorded a single process start time (gen_time) in .kati_stamp and compared every makefile and extra file dependency against it during --regen check.
This caused false invalidations in two common scenarios:
On subsequent builds, Kati would see file.mtime > gen_time and falsely conclude that the files were modified, triggering unnecessary full reanalysis.
This change stores each file's observed mtime alongside its path in .kati_stamp (both in ckati and rkati). During --regen, each file's current mtime is compared against its recorded mtime. If the file's mtime has not advanced, it is recognized as clean.