git/Documentation/technical
Kristofer Karlsson 56c9056e30 commit-reach: remove commit-date ordering fallback
Remove the fallback that switched paint_down_to_common() from
generation ordering to commit-date ordering when the commit-graph
lacks corrected commit dates (v1 graph with topo levels only).

The fallback was added in 091f4cf3 (commit: don't use generation
numbers if not needed, 2018-08-30) to avoid a performance
regression on the Linux kernel repo where v1 topo levels caused
"git merge-base v4.8 v4.9" to walk 636k commits instead of 167k.
A side branch with a low topo level stayed in the queue behind a
long chain, preventing early STALE propagation.

Side-exhaustion (added in the previous commits) solves this
differently by terminating the walk as soon as one paint side
empties from the queue, preventing the deep walk regardless of
queue ordering. Benchmarks of "git merge-base --all v4.8 v4.9"
on the Linux kernel repo show that side-exhaustion reduces the
step count far below what the date-ordering fallback achieved:

                         steps      time
  no graph, baseline:   167,413    3.25 s
  v1 graph, baseline:   167,413    0.25 s
  v2 graph, baseline:   167,441    0.29 s
  v1 graph, this series:  5,725    0.02 s
  v2 graph, this series:  3,887    0.01 s

With generation ordering always active, the existing min_generation
check in paint_queue_get() can safely terminate once the walk
crosses below the caller's generation floor. The date ordering
fallback broke this invariant: a commit could have a finite topo
level while the queue was date-ordered, causing the early exit to
fire before all merge bases were found.

With the fallback removed, gen_ordered is always true and can be
dropped. The topo_ceiling field (introduced earlier) already
handles V1_MAX saturation, so the early exit gates need no further
changes.

Signed-off-by: Kristofer Karlsson <krka@spotify.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-11 07:34:32 -07:00
..
.gitignore
api-error-handling.adoc
api-index-skel.adoc
api-index.sh
api-merge.adoc
api-parse-options.adoc
api-path-walk.adoc path-walk: always emit directly-requested objects 2026-05-24 18:41:06 +09:00
api-simple-ipc.adoc
api-trace2.adoc doc: replace git config --list/-l with `list` 2026-04-06 09:57:07 -07:00
bitmap-format.adoc
build-systems.adoc doc: fix typos via codespell 2026-06-08 00:21:35 +09:00
bundle-uri.adoc
commit-graph.adoc doc: commit-graph.adoc: fix up some formatting 2025-10-16 13:55:52 -07:00
directory-rename-detection.adoc
hash-function-transition.adoc doc: fix typo in GIT_ALTERNATE_OBJECT_DIRECTORIES 2026-06-06 11:04:03 +09:00
large-object-promisors.adoc doc: add large-object-promisors.adoc to the docs build 2025-10-16 13:55:53 -07:00
long-running-process-protocol.adoc
meson.build Documentation/technical: add paint-down-to-common doc 2026-08-11 07:34:31 -07:00
multi-pack-index.adoc
pack-heuristics.adoc
packfile-uri.adoc
paint-down-to-common.adoc commit-reach: remove commit-date ordering fallback 2026-08-11 07:34:32 -07:00
parallel-checkout.adoc
partial-clone.adoc
platform-support.adoc
racy-git.adoc
reftable.adoc
remembering-renames.adoc doc: remembering-renames.adoc: fix asciidoc warnings 2025-10-16 13:55:52 -07:00
repository-version.adoc
rerere.adoc
scalar.adoc
send-pack-pipeline.adoc
shallow.adoc
sparse-checkout.adoc doc: sparse-checkout.adoc: fix asciidoc warnings 2025-10-16 13:55:52 -07:00
sparse-index.adoc
trivial-merge.adoc
unambiguous-types.adoc doc: define unambiguous type mappings across C and Rust 2025-11-18 14:53:09 -08:00
unit-tests.adoc