Two defects in one place, and both were found by being bitten rather than by review.
1. A spec owns more than one seal, --save writes one
Measured over .trinity/seals:
|
|
| seal files |
1313 |
| distinct specs they name |
728 |
| specs carrying more than one seal |
547 |
| of those, the same module under two names |
501 |
The pattern is a naming scheme that changed: <Module>.json beside <dir>_<Module>.json.
Refreshing 116 stale seals through this command in #3416 reached 58 and stopped for exactly this reason, and the remaining 58 had to be rewritten by hand. It bit again one pass later in #3417: editing four specs produced ten stale seals, and --save would have fixed four.
The duplicates are not deletable. bootstrap/src/math_compare.rs opens .trinity/seals/PellisFormulas.json by its bare name, and that file is one of a pair with physics_PellisFormulas.json. So the tool has to maintain them.
93 specs also carry a seal whose name is not an identifier at all — specs/tri/utils/logger.t27 has "[]const u8".json, utils_"[]const u8".json and utils_TriLogger.json. A seal named after a type string. Left alone here.
2. The derived name can differ from the tracked file only in case
seal_file_path computes <parent>_<module>.json. For specs/ar/restraint.t27 that is ar_restraint.json, while the tracked file is ar_Restraint.json.
| filename vs derived name |
seals |
| identical |
751 |
| differs only by case |
4 |
older bare-<module> scheme |
558 |
macOS resolves those to one file and hides it. On the case-sensitive filesystem CI runs on, --save creates a second seal for the same spec, and neither looks wrong.
The test for the second half cannot fail on macOS, and says so
Verified by mutation: making the lookup case-sensitive leaves the test green here, because the filesystem is case-insensitive — creating Aa then aA yields one file. The test now probes the filesystem and skips loudly rather than reporting a pass it did not earn:
SKIP save_writes_into_an_existing_case_variant: this filesystem is case-insensitive,
so the assertion cannot distinguish the guard from its absence
It discriminates on Linux, which is where CI runs. The other test — that a stale duplicate is refreshed — does fail on the mutant here.
Two defects in one place, and both were found by being bitten rather than by review.
1. A spec owns more than one seal,
--savewrites oneMeasured over
.trinity/seals:The pattern is a naming scheme that changed:
<Module>.jsonbeside<dir>_<Module>.json.Refreshing 116 stale seals through this command in #3416 reached 58 and stopped for exactly this reason, and the remaining 58 had to be rewritten by hand. It bit again one pass later in #3417: editing four specs produced ten stale seals, and
--savewould have fixed four.The duplicates are not deletable.
bootstrap/src/math_compare.rsopens.trinity/seals/PellisFormulas.jsonby its bare name, and that file is one of a pair withphysics_PellisFormulas.json. So the tool has to maintain them.93 specs also carry a seal whose name is not an identifier at all —
specs/tri/utils/logger.t27has"[]const u8".json,utils_"[]const u8".jsonandutils_TriLogger.json. A seal named after a type string. Left alone here.2. The derived name can differ from the tracked file only in case
seal_file_pathcomputes<parent>_<module>.json. Forspecs/ar/restraint.t27that isar_restraint.json, while the tracked file isar_Restraint.json.<module>schememacOS resolves those to one file and hides it. On the case-sensitive filesystem CI runs on,
--savecreates a second seal for the same spec, and neither looks wrong.The test for the second half cannot fail on macOS, and says so
Verified by mutation: making the lookup case-sensitive leaves the test green here, because the filesystem is case-insensitive — creating
AathenaAyields one file. The test now probes the filesystem and skips loudly rather than reporting a pass it did not earn:It discriminates on Linux, which is where CI runs. The other test — that a stale duplicate is refreshed — does fail on the mutant here.