git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] commit-graph: add trace2 instrumentation for generation DFS

From
Kristofer Karlsson <krka@spotify.com>
Date
Jul 7, 2026, 14:08 UTC
Message-ID
<CAL71e4PuD9D8LRbP3mfxxeMrM+1q--3sCp6oJs=hezdasZUPMw@mail.gmail.com>
In-Reply-To
<ak0DUx5Y/5y1OINz@nand.local>
On Tue, 7 Jul 2026 at 15:47, Taylor Blau <me@ttaylorr.com> wrote:
Show 11 quoted lines
>
> > Add a test that demonstrates the problem: with a two-layer
> > split commit-graph, writing a new incremental layer for a
> > commit whose parent is in the base layer walks all the way
> > down to the root (7 steps for 5 base commits) instead of
> > reading the existing topo level and stopping immediately
> > (1 step).
>
> This paragraph only describes verbatim what is already included in the
> patch. I think we could easily do without it, but I do not feel so
> strongly about it.
I also don't feel strongly about it, I could remove it entirely.
Show 10 quoted lines
> > +     intmax_t steps = 0;
>
> Any reason that this should be signed? Obviously in practice, I don't
> think we're going to wrap around with a greater-than-INT_MAX number of
> commits here, but perhaps we would at the very least prefer uintmax_t.
>
> I guess trace2 only has a data_intmax() function, so perhaps the point
> is moot. Regardless, it seems that we would want to have a convenience
> wrapper to be able to print out unsigned integer values which are
> otherwise un-representable as signed integers.

Yes, my only rationale here was to match the type that trace2_data_intmax expects - and as you say, it's very unlikely that we'll need to use all bits anyway, and since this is only used for testing and debugging, and overflows would be noticed that way and would not affect general correctness.

Show 6 quoted lines
> Instead of writing "# BUG ..." and then an incorrect assertion, I
> would suggest that you write the assertion you expect:
>
>     test_trace2_data commit-graph generation-dfs-steps 1 <trace.txt
>
> , but mark the test as "test_expect_failure".

I started with this actually and then changed my mind in order to demonstrate exactly how the counter changed, not just that it changed from failure to success. But I'd be happy to change this too if needed - it would effectively reduce the second commit to just the bugfix line and switching from test_expect_failure to test_expect_success.

Thanks, Kristofer

Previous: Taylor BlauNext: Taylor Blau
Message 4 of 28 in “commit-graph: fix topo_levels slab propagation regression”
  1. 0/2 commit-graph: fix topo_levels slab propagation regressionKristofer Karlsson via GitGitGadget, Jul 7, 2026
  2. 1/2 commit-graph: add trace2 instrumentation for generation DFSKristofer Karlsson via GitGitGadget, Jul 7, 2026
  3. Taylor BlauJul 7, 2026
  4. Kristofer KarlssonJul 7, 2026
  5. Taylor BlauJul 10, 2026
  6. Junio C HamanoJul 10, 2026
  7. Taylor BlauJul 10, 2026
  8. Junio C HamanoJul 11, 2026
  9. Kristofer KarlssonJul 13, 2026
  10. Junio C HamanoJul 13, 2026
  11. Kristofer KarlssonJul 13, 2026
  12. Junio C HamanoJul 7, 2026
  13. Kristofer KarlssonJul 7, 2026
  14. 2/2 commit-graph: propagate topo_levels slab to all chain layersKristofer Karlsson via GitGitGadget, Jul 7, 2026
  15. Taylor BlauJul 7, 2026
  16. Kristofer KarlssonJul 7, 2026
  17. Kristofer KarlssonJul 7, 2026
  18. Taylor BlauJul 10, 2026
  19. Patrick SteinhardtJul 13, 2026
  20. Taylor BlauJul 14, 2026
  21. Junio C HamanoJul 7, 2026
  22. Kristofer KarlssonJul 7, 2026
  23. Junio C HamanoJul 7, 2026
  24. Patrick SteinhardtJul 9, 2026
  25. 0/2 commit-graph: fix topo_levels slab propagation regressionKristofer Karlsson via GitGitGadget, Jul 9, 2026
  26. 1/2 commit-graph: add trace2 instrumentation for generation DFSKristofer Karlsson via GitGitGadget, Jul 9, 2026
  27. 2/2 commit-graph: propagate topo_levels slab to all chain layersKristofer Karlsson via GitGitGadget, Jul 9, 2026
  28. Taylor BlauJul 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.