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

Re: [PATCH v2 01/19] Documentation: describe incremental MIDX format

From
Jeff King <peff@peff.net>
Date
Aug 1, 2024, 09:19 UTC
Message-ID
<20240801091952.GA1159276@coredump.intra.peff.net>
In-Reply-To
<014588b3ecf2e32a6ab1af8e77234dfb2f9ea75a.1721250704.git.me@ttaylorr.com>
On Wed, Jul 17, 2024 at 05:11:58PM -0400, Taylor Blau wrote:
Show 31 quoted lines
> +Each individual component of the chain need only contain a small number
> +of packfiles. Appending to the chain does not invalidate earlier parts
> +of the chain, so repositories can control how much time is spent
> +updating the MIDX chain by determining the number of packs in each layer
> +of the MIDX chain.
> +
> +=== Design state
> +
> +At present, the incremental multi-pack indexes feature is missing two
> +important components:
> +
> +  - The ability to rewrite earlier portions of the MIDX chain (i.e., to
> +    "compact" some collection of adjacent MIDX layers into a single
> +    MIDX). At present the only supported way of shrinking a MIDX chain
> +    is to rewrite the entire chain from scratch without the `--split`
> +    flag.
> ++
> +There are no fundamental limitations that stand in the way of being able
> +to implement this feature. It is omitted from the initial implementation
> +in order to reduce the complexity, but will be added later.
> +
> +  - Support for reachability bitmaps. The classic single MIDX
> +    implementation does support reachability bitmaps (see the section
> +    titled "multi-pack-index reverse indexes" in
> +    linkgit:gitformat-pack[5] for more details).
> ++
> +As above, there are no fundamental limitations that stand in the way of
> +extending the incremental MIDX format to support reachability bitmaps.
> +The design below specifically takes this into account, and support for
> +reachability bitmaps will be added in a future patch series. It is
> +omitted from this series for the same reason as above.

It is nice that you added a bit of a roadmap here about what is implemented and what is not, and that the design takes into account future directions (especially incremental bitmap generation).

It does feel a little funny to say "this series" in text that will go into the repository (i.e., somebody reading the checked out file will say "huh? which series?"). I'm not sure how to word it better, except to maybe just say "in the future" and "it is omitted for now" (and obviously it's a pretty minor point).

Show 8 quoted lines
> +In brief, to support reachability bitmaps with the incremental MIDX
> +feature, the concept of the pseudo-pack order is extended across each
> +layer of the incremental MIDX chain to form a concatenated pseudo-pack
> +order. This concatenation takes place in the same order as the chain
> +itself (in other words, the concatenated pseudo-pack order for a chain
> +`{$H1, $H2, $H3}` would be the pseudo-pack order for `$H1`, followed by
> +the pseudo-pack order for `$H2`, followed by the pseudo-pack order for
> +`$H3`).

OK, that makes sense. It's how I'd have intuitively assumed it to be, and most importantly, it should allow appending to the chain without regenerating (or even translating) earlier bitmaps.

Show 27 quoted lines
> +=== File layout
> +
> +Instead of storing a single `multi-pack-index` file (with an optional
> +`.rev` and `.bitmap` extension) in `$GIT_DIR/objects/pack`, incremental
> +MIDXs are stored in the following layout:
> +
> +----
> +$GIT_DIR/objects/pack/multi-pack-index.d/
> +$GIT_DIR/objects/pack/multi-pack-index.d/multi-pack-index-chain
> +$GIT_DIR/objects/pack/multi-pack-index.d/multi-pack-index-$H1.midx
> +$GIT_DIR/objects/pack/multi-pack-index.d/multi-pack-index-$H2.midx
> +$GIT_DIR/objects/pack/multi-pack-index.d/multi-pack-index-$H3.midx
> +----
> +
> +The `multi-pack-index-chain` file contains a list of the incremental
> +MIDX files in the chain, in order. The above example shows a chain whose
> +`multi-pack-index-chain` file would contain the following lines:
> +
> +----
> +$H1
> +$H2
> +$H3
> +----
> +
> +The `multi-pack-index-$H1.midx` file contains the first layer of the
> +multi-pack-index chain. The `multi-pack-index-$H2.midx` file contains
> +the second layer of the chain, and so on.

Makes sense. How does the chained multi-pack-index.d interact with a singular multi-pack-index? Generally we should not have both at the same time, but I'd imagine they both exist for a brief period when moving from one to another.

I assume the rules are the same as for commit-graphs, which use the same on-disk structure. I can't think of a reason to prefer one over the other but this might be a good place to document what does/should happen.

Show 7 quoted lines
> +=== Object positions for incremental MIDXs
> +
> +In the original multi-pack-index design, we refer to objects via their
> +lexicographic position (by object IDs) within the repository's singular
> +multi-pack-index. In the incremental multi-pack-index design, we refer
> +to objects via their index into a concatenated lexicographic ordering
> +among each component in the MIDX chain.

How do duplicate objects work here? I guess there aren't any duplicates in the midx itself, only in the constituent packfiles. So from the perspective of this section, I guess it doesn't matter? And from the perspective of bitmaps (where the duplicate issue came up before), it is business as usual: the midx revindex gives the bit order, and we'd presumably concatenate the individual revindexes in chain order.

(Mostly just thinking out loud; I'm not sure there's much for you to answer there).

Looking good so far...
-Peff
Previous: Taylor BlauNext: Taylor Blau
Message 30 of 102 in “midx: incremental multi-pack indexes, part one”
  1. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Jun 6, 2024
  2. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Jun 6, 2024
  3. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Jun 6, 2024
  4. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  5. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  6. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  7. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  8. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Jun 6, 2024
  9. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  10. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  11. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  12. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Jun 6, 2024
  13. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  14. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  15. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Jun 6, 2024
  16. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Jun 6, 2024
  17. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Jun 6, 2024
  18. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Jun 6, 2024
  19. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Jun 6, 2024
  20. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Jun 6, 2024
  21. Taylor BlauJun 6, 2024
  22. Junio C HamanoJun 7, 2024
  23. Taylor BlauJun 7, 2024
  24. Junio C HamanoJun 7, 2024
  25. Taylor BlauJun 7, 2024
  26. Junio C HamanoJun 25, 2024
  27. Elijah NewrenJun 26, 2024
  28. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Jul 17, 2024
  29. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Jul 17, 2024
  30. Jeff KingAug 1, 2024
  31. Taylor BlauAug 1, 2024
  32. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Jul 17, 2024
  33. Jeff KingAug 1, 2024
  34. Taylor BlauAug 1, 2024
  35. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  36. Jeff KingAug 1, 2024
  37. Taylor BlauAug 1, 2024
  38. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  39. Jeff KingAug 1, 2024
  40. Taylor BlauAug 1, 2024
  41. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  42. Jeff KingAug 1, 2024
  43. Taylor BlauAug 1, 2024
  44. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  45. Jeff KingAug 1, 2024
  46. Taylor BlauAug 1, 2024
  47. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Jul 17, 2024
  48. Jeff KingAug 1, 2024
  49. Taylor BlauAug 1, 2024
  50. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  51. Jeff KingAug 1, 2024
  52. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  53. Jeff KingAug 1, 2024
  54. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  55. Jeff KingAug 1, 2024
  56. Taylor BlauAug 1, 2024
  57. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Jul 17, 2024
  58. Jeff KingAug 1, 2024
  59. Taylor BlauAug 1, 2024
  60. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  61. Jeff KingAug 1, 2024
  62. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  63. Jeff KingAug 1, 2024
  64. Taylor BlauAug 1, 2024
  65. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Jul 17, 2024
  66. Jeff KingAug 1, 2024
  67. Taylor BlauAug 1, 2024
  68. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Jul 17, 2024
  69. Jeff KingAug 1, 2024
  70. Taylor BlauAug 1, 2024
  71. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Jul 17, 2024
  72. Jeff KingAug 1, 2024
  73. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Jul 17, 2024
  74. Jeff KingAug 1, 2024
  75. Taylor BlauAug 1, 2024
  76. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Jul 17, 2024
  77. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Jul 17, 2024
  78. Jeff KingAug 1, 2024
  79. Taylor BlauAug 1, 2024
  80. Jeff KingAug 1, 2024
  81. Taylor BlauAug 1, 2024
  82. 00/19 midx: incremental multi-pack indexes, part oneTaylor Blau, Aug 6, 2024
  83. 01/19 Documentation: describe incremental MIDX formatTaylor Blau, Aug 6, 2024
  84. 02/19 midx: add new fields for incremental MIDX chainsTaylor Blau, Aug 6, 2024
  85. 03/19 midx: teach `nth_midxed_pack_int_id()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  86. 04/19 midx: teach `prepare_midx_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  87. 05/19 midx: teach `nth_midxed_object_oid()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  88. 06/19 midx: teach `nth_bitmapped_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  89. 07/19 midx: introduce `bsearch_one_midx()`Taylor Blau, Aug 6, 2024
  90. 08/19 midx: teach `bsearch_midx()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  91. 09/19 midx: teach `nth_midxed_offset()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  92. 10/19 midx: teach `fill_midx_entry()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  93. 11/19 midx: remove unused `midx_locate_pack()`Taylor Blau, Aug 6, 2024
  94. 12/19 midx: teach `midx_contains_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  95. 13/19 midx: teach `midx_preferred_pack()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  96. 14/19 midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXsTaylor Blau, Aug 6, 2024
  97. 15/19 midx: support reading incremental MIDX chainsTaylor Blau, Aug 6, 2024
  98. 16/19 midx: implement verification support for incremental MIDXsTaylor Blau, Aug 6, 2024
  99. 17/19 t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'Taylor Blau, Aug 6, 2024
  100. 18/19 t/t5313-pack-bounds-checks.sh: prepare for sub-directoriesTaylor Blau, Aug 6, 2024
  101. 19/19 midx: implement support for writing incremental MIDX chainsTaylor Blau, Aug 6, 2024
  102. Jeff KingAug 12, 2024

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.