Split out of #939 review. Reachable on main today for C++; #939 would have extended it to Java/C#.
Problem
full_build refuses to record cpp_identity_version when any C++ file failed to parse,
because a failed file keeps its old-format edges:
if not cpp_errors:
store.set_metadata(_CPP_IDENTITY_METADATA_KEY, CPP_IDENTITY_VERSION)
incremental_update then sees a stale identity version and triggers full_build. If the
file fails every time — genuinely malformed, unreadable, or hitting a parser bug — the
marker is never recorded and every incremental update becomes a full rebuild,
indefinitely.
Reproduction
Simulated a Java file that always raises during parse, using the #939 branch (same logic,
extended to Java/C#):
inherits_identity_version after failed build: None
update 1: identity_rebuild = True
update 2: identity_rebuild = True
update 3: identity_rebuild = True
Substituting a C++ file reproduces the same loop against main.
Why it matters
The guard is correct in intent — marking the version current while a file retains stale
edges would mean never retrying it. But the current shape converts one bad file into a
permanent, repo-wide performance cliff, and it is silent apart from an INFO log.
Possible directions
- Record the version and track the specific failed files, so only those are retried
rather than rebuilding everything.
- Record the version after a rebuild attempt regardless, accepting that a permanently
unparseable file keeps stale edges (it has no valid edges to offer anyway).
- Bound retries, e.g. attempt the identity rebuild once and record the attempt.
Worth fixing for C++ and any future identity version together, so the mechanism has one
agreed behaviour.
Split out of #939 review. Reachable on
maintoday for C++; #939 would have extended it to Java/C#.Problem
full_buildrefuses to recordcpp_identity_versionwhen any C++ file failed to parse,because a failed file keeps its old-format edges:
incremental_updatethen sees a stale identity version and triggersfull_build. If thefile fails every time — genuinely malformed, unreadable, or hitting a parser bug — the
marker is never recorded and every incremental update becomes a full rebuild,
indefinitely.
Reproduction
Simulated a Java file that always raises during parse, using the #939 branch (same logic,
extended to Java/C#):
Substituting a C++ file reproduces the same loop against
main.Why it matters
The guard is correct in intent — marking the version current while a file retains stale
edges would mean never retrying it. But the current shape converts one bad file into a
permanent, repo-wide performance cliff, and it is silent apart from an INFO log.
Possible directions
rather than rebuilding everything.
unparseable file keeps stale edges (it has no valid edges to offer anyway).
Worth fixing for C++ and any future identity version together, so the mechanism has one
agreed behaviour.