Repository navigation
fix(gix-diff): apply the rewrite limit to each side like Git - #3062
Conversation
Rewrites::limit compared the combination count against the unsquared limit so similarity tracking didn't match git's diff.renameLimit behaviour or the docs.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e571a92732
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
Addressed CI review comment. Besides that the change seemed fine and passed. <!-- agent --> **Compare squared limits without saturating both products** On the supported 32-bit targets, when `limit` exceeds 65,535 and both candidate counts are just above that limit (for example, 70,001 sources and destinations with a limit of 70,000), both multiplications saturate to `usize::MAX`; the `>` comparison is therefore false and fuzzy matching runs billions of comparisons even though the true product exceeds `limit²`. Use a wider or otherwise overflow-free comparison for the gate, while retaining a saturated value only for the outcome statistic. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
<!-- agent --> `cargo deny --workspace --all-features check advisories` rejects the locked `rustls` 0.23.45 used by the Reqwest and Curl HTTP transport backends: - `RUSTSEC-2026-0346`: client session `Debug` output can expose TLS secrets. - `RUSTSEC-2026-0347`: buffered application data can reach the outer server after Encrypted Client Hello rejection. - `RUSTSEC-2026-0348`: Brotli certificate decompression can allocate up to 1 GiB before authentication. - `RUSTSEC-2026-0349`: an unauthenticated `ServerHello` can downgrade key exchange on subsequent connections. Update only `rustls` and its checksum in `Cargo.lock` to the patched 0.23.46 release. Existing dependency requirements accept this patch without manifest changes or advisory exceptions. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
|
Thanks a lot, great catch! |
Rewrites::limit compared the combination count against the unsquared limit so similarity tracking didn't match git's diff.renameLimit behaviour or the docs.
This cause was discovered by an AI agent (Claude Code Opus5.5) but the fix and tests are mine.
jj's copy tracking uses the default limit of 1000 so a diff that moves some edited files gets no similarity-based renames. In my case I had a package move with 32 deleted and 34 added files which is 1088 combinations.
git diff -M50%paired 31 of them. gix didn't pair any of them but reported 1312 skipped checks.After this change and jj's rename options gix gives same pairings as Git.