Skip to content

perf(build): first rebuild after a cold build recompiles once (signature drift between cold and steady state) #957

Description

@zackees

Context

With #951 fixed (PR #956), a no-change rebuild of NightDriverStrip demo drops to 2.1 s — but only from the second rebuild onward. The first rebuild after a cold build still recompiles everything once (107 s in the #942 harness):

cold: 780s   hot #1: 107s   hot #2: 2s

The .cmdhash signatures written during the cold build evidently hash a different flag/include assembly than the one the steady-state check computes — most plausibly the include-dir set or its ordering differs while libraries/framework pieces are still being installed mid-cold-build. The first hot rebuild rewrites the stamps under the steady-state assembly, and everything after matches.

Proposal

Instrument the mismatch (log the first differing signature component between write and check for one TU), then make the assembly deterministic — likely stable ordering/normalization of include dirs in CompilerBase::build_include_flags inputs, or computing the written signature from the same assembly the checker will later derive.

Acceptance criteria

Part of #942. Follow-up to #951 / PR #956.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions