Artifact 9fbff308f369ded3dee7a846f03e6cf9708d4cbd96b0498390894d7342ba128e:
- File
src/stamp.h
— part of check-in
[6d70dcc76a]
at
2026-11-12 19:36:41
on branch trunk
— Phase 1: the config parser, the no-change run and the speed bench
suit check parses suit.conf strictly and prints a canonical dump. Any unknown kind or key, duplicate, cycle or dangling name rejects the whole file with its line number.
suit run compares a stamp against the files it names and exits without writing, allocating or printing when nothing changed.
suit bench times suit run against an empty program built the same way and against /usr/bin/true, interleaved, and fails the build when the no-change run costs more than 1 ms over the empty program or 1 MiB more memory. It measured 0.65 to 0.94 ms over, quiet and under load. A system binary starts 0.6 to 1.5 ms faster than any built binary on macOS, so it is shown for information and is not the baseline.
94 unit checks, 100 shell cases and a libFuzzer target for the parser. (user: dmestas, size: 650) [annotate] [blame] [check-ins using]
#ifndef SUIT_STAMP_H #define SUIT_STAMP_H #include <stddef.h> constexpr int EXIT_UNCHANGED = 0; constexpr int EXIT_CHANGED = 10; constexpr int EXIT_NO_STAMP = 11; constexpr int EXIT_BAD_STAMP = 12; constexpr size_t STAMP_FILE_MAX = 1048576; constexpr size_t STAMP_PATH_MAX = 4096; // Writes $SUIT_HOME/stamp (default ~/.suit/stamp) atomically. Returns 0 or a // nonzero exit code after reporting on stderr. int stamp_write(int npaths, char *const *paths); // The no-change compare. Reads the stamp, stats each path, and writes only // to stdout and stderr: no file is created or changed and nothing is // allocated. int stamp_run(void); #endif