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

Re: [PATCH 1/3] revision: support tracking uninteresting commits

From
Derrick Stolee <derrickstolee@github.com>
Date
May 4, 2023, 13:59 UTC
Message-ID
<7a0ea3d7-f67b-8f9d-f9ea-550fcc05108d@github.com>
In-Reply-To
<ZFLbXTKOK6KTEy7q@nand.local>
On 5/3/2023 6:08 PM, Taylor Blau wrote:
Show 10 quoted lines
> On Tue, Apr 25, 2023 at 02:15:49PM -0400, Derrick Stolee wrote:
>> I know that the walking code in builtin/pack-objects.c does
>> this same computation, but it's muddled with other checks and
>> the trees are marked as UNINTERESTING at the same time. It
>> doesn't seem like we can reuse anything directly out of there,
>> but it did give me the idea to try a callback.
> 
> Interesting idea. When you say callback, do you mean a function that we
> invoke in place of where we currently call `add_object_array()`? Or do
> you mean something else? Curious.

I was talking about passing a callback into the revision walk instead of having the revision code create a list, as you replied to in this response:

Show 7 quoted lines
>> But could we also do this at the caller's end by passing a
>> callback that checks each walked commit if it is UNINTERESTING
>> and adds it to a set?
> 
> I think I remember trying this when I originally wrote this code, and
> ended up discarding the idea because it walked over more commits than we
> needed to consider.
 
It's interesting that it walked more commits than you wanted. I
suppose it's somehow related to the boundary condition you're
implying by enabling the construction of this list.

Could you describe the situation where more commits are walked than you want? I imagine we can't actually stop at the boundary because we need to know that certain commits are actually reachable from those boundary commits.

Here's an example (assume horizontal levels are equal generation number for the sake of the walk's stopping condition).

  1 (UNINTERESTING)  2 (INTERESTING)
  |\_____       ____/|
  |      \     /     |
  3       4    5     6
  |       |\__ |     |
  |       |   \|     |
  7       8   [9]    10
  |       |    |     |
  11      12   13    14
  |       |    | ___/|
  |       |    |/    |
  15      16  [17]   18
  |       | ___|____/
  |       |/   |
 (19)    [20]   21

Here, 9, 17, and 20 are the boundary, as they are UNINITERESTING but reachable from an interesting commit (5, 14, and 18, respectively). This is sufficient to provide a stopping point for this single-directional difference "2 --not 1".

It's important that we didn't stop walking at 9, since its UNINTERESTING bit needed to propagate through 13 to get to 17.

Note that 19 is reachable from 1 but not 2, so we would need to keep walking if we were looking for the boundary of the symmetric difference 1...2. But we don't need it here since everything at that level is marked UNINTERESTING so the walk can stop.

Is this example sufficiently complex for you to describe what causes the extra commit walking? In such a case, what does the object array approach add to prevent the extra walking?

Thanks, -Stolee

Previous: Taylor BlauNext: Taylor Blau
Message 7 of 51 in “pack-bitmap: boundary-based bitmap traversal”
  1. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, Apr 25, 2023
  2. 1/3 revision: support tracking uninteresting commitsTaylor Blau, Apr 25, 2023
  3. Derrick StoleeApr 25, 2023
  4. Taylor BlauMay 3, 2023
  5. Derrick StoleeMay 4, 2023
  6. Taylor BlauMay 3, 2023
  7. Derrick StoleeMay 4, 2023
  8. Taylor BlauMay 5, 2023
  9. Junio C HamanoApr 25, 2023
  10. Taylor BlauApr 25, 2023
  11. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, Apr 25, 2023
  12. Junio C HamanoApr 25, 2023
  13. Taylor BlauApr 25, 2023
  14. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, Apr 25, 2023
  15. Junio C HamanoApr 25, 2023
  16. Felipe ContrerasMay 2, 2023
  17. Taylor BlauMay 3, 2023
  18. Junio C HamanoMay 3, 2023
  19. Derrick StoleeApr 25, 2023
  20. Junio C HamanoApr 25, 2023
  21. Derrick StoleeApr 25, 2023
  22. Taylor BlauApr 25, 2023
  23. Derrick StoleeApr 25, 2023
  24. Taylor BlauMay 3, 2023
  25. Derrick StoleeApr 25, 2023
  26. Taylor BlauApr 25, 2023
  27. Derrick StoleeApr 25, 2023
  28. Junio C HamanoMay 1, 2023
  29. Taylor BlauMay 2, 2023
  30. 0/2 pack-bitmap: boundary-based bitmap traversalTaylor Blau, May 5, 2023
  31. 1/2 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, May 5, 2023
  32. 2/2 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, May 5, 2023
  33. Derrick StoleeMay 5, 2023
  34. Taylor BlauMay 5, 2023
  35. Junio C HamanoMay 5, 2023
  36. Derrick StoleeMay 5, 2023
  37. Taylor BlauMay 5, 2023
  38. Derrick StoleeMay 5, 2023
  39. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, May 8, 2023
  40. 1/3 object: add object_array initializer helper functionTaylor Blau, May 8, 2023
  41. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, May 8, 2023
  42. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, May 8, 2023
  43. Derrick StoleeMay 8, 2023
  44. Taylor BlauMay 8, 2023
  45. Junio C HamanoMay 10, 2023
  46. Taylor BlauMay 10, 2023
  47. Derrick StoleeMay 11, 2023
  48. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, Jun 8, 2023
  49. 1/3 object: add object_array initializer helper functionTaylor Blau, Jun 8, 2023
  50. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, Jun 8, 2023
  51. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, Jun 8, 2023

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.