Skip to content

cats fixture profile hash only matches CRLF checkouts #130

Closed

Description

@vycdev

cats captured observations and artifact hashes remain immutable (tests/optimizerEvidence.test.ts:121) fails on a clean develop checkout on macOS:

+ '0df2f2662da5c8e084654bc48c69238adcc2e7a33ee62186dd39d24b55e874e7'   (actual: sha256 of profile.kfil)
- '42b7259d58a1babea72d7d9e561d6240338b111246312cc00ae418f23786d091'   (expected: cats/case.json sha256.profile)

Cause: line endings. tests/assets/performance/8-colors-frontlit-2026-08-26/profile.kfil has been committed once (f2e0956, 2026-08-27) and its blob uses LF line endings. That blob hashes to 0df2f266…. Converting it to CRLF gives exactly 42b7259d…. The expected hash was recorded from a checkout where git converted the file to CRLF (for example Windows with core.autocrlf=true). The test hashes raw bytes, so it only passes on such checkouts.

The same CRLF hash appears in all four case.json files under 8-colors-frontlit-2026-08-26/, tests/benchmark/cats-exact-reproducibility.md and tests/benchmark/results/cats-exact/2026-11-01/calibrated-series-summary.json. Only the cats test asserts it.

.gitattributes already protects tests/benchmark/results/cats-exact/** with -text, but not the tests/assets/performance/ fixtures.

Options:

  1. Hash the profile with line endings normalized (CRLF → LF) in the test, and record the LF hash. This keeps working on every platform, but changes what the "captured" hash means.
  2. Add tests/assets/performance/**/*.kfil -text (and any other hashed text fixtures) to .gitattributes, so checkouts keep the committed LF bytes on every platform, then update the recorded hashes to the LF value 0df2f266….
  3. Option 2, plus documenting in the reproducibility notes that the earlier 42b7259d… was the CRLF form of the same file.

Option 2 or 3 seems closest to the test's intent (byte-level immutability of artifacts). Check whether other hashed text fixtures, such as the .json inputs, have the same problem on Windows.

Activity

  1. added a commit that references this issue on Nov 7, 2026
    078e2f0
  2. vycdev commented on Nov 7, 2026

    @vycdev
    OwnerAuthor

    Fixed in 078e2f0, merged into develop with #124. Profile files and the performance fixture JSON now keep their committed LF bytes on every platform (-text in .gitattributes). The cats fixtures record the LF profile hash (0df2f266…), and tests/benchmark/cats-exact-reproducibility.md explains that the archived 42b7259d… is the CRLF form of the same file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions