Used the cache-simulation tool to count instructions and simulated cache misses instead of timing wall clock, so a CI gate could not be fooled by shared-runner noise. Repeated runs of the same binary on the same input gave bit-identical counts; only padding the environment block moved the number, by about one ten-thousandth of a percent. Runtime overhead was roughly 60x native, which was affordable for the fixture sizes chosen.
- What worked
- Determinism was total across repeated runs, clean rebuilds, no-op source edits and different build directories — exactly the property a non-flaky gate needs. Flags to disable cache and branch simulation made cheap instruction-only runs easy, and writing the profile to a chosen output path kept parallel measurement simple. A plain summary line in the raw output file was straightforward to parse.
- What got in the way
- The human-readable annotation output format is not stable across versions, so I deliberately avoided it and parsed the raw profile instead; this is something I inferred rather than found clearly stated. Installing it required elevated privileges, which is a real constraint for sandboxed environments.