From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>,
Jonathan Tan <jonathantanmy@google.com>
Subject: Re: [PATCH v6 13/16] commit-graph: new Bloom filter version that fixes murmur3
Date: Sun, 25 Feb 2024 23:15:24 +0100 [thread overview]
Message-ID: <20240225221524.GA1940392@szeder.dev> (raw)
In-Reply-To: <d2f11c082d3bf10d9127c330a7d59b7e47ac4f21.1706741516.git.me@ttaylorr.com>
On Wed, Jan 31, 2024 at 05:52:54PM -0500, Taylor Blau wrote:
> diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
> index 93b8d096cf..a7bf3a7dca 100755
> --- a/t/t4216-log-bloom.sh
> +++ b/t/t4216-log-bloom.sh
> @@ -485,6 +485,33 @@ test_expect_success 'merge graph layers with incompatible Bloom settings' '
> test_must_be_empty err
> '
>
> +test_expect_success 'ensure Bloom filter with incompatible versions are ignored' '
> + rm "$repo/$graph" &&
> +
> + git -C $repo log --oneline --no-decorate -- $CENT >expect &&
The $CENT variable is not set at this point in the test script.
However, even if it were, the repository used in this test case
doesn't contain any file with that name.
> +
> + # Compute v1 Bloom filters for commits at the bottom.
> + git -C $repo rev-parse HEAD^ >in &&
> + git -C $repo commit-graph write --stdin-commits --changed-paths \
> + --split <in &&
> +
> + # Compute v2 Bloomfilters for the rest of the commits at the top.
> + git -C $repo rev-parse HEAD >in &&
> + git -C $repo -c commitGraph.changedPathsVersion=2 commit-graph write \
> + --stdin-commits --changed-paths --split=no-merge <in &&
> +
> + test_line_count = 2 $repo/$chain &&
> +
> + git -C $repo log --oneline --no-decorate -- $CENT >actual 2>err &&
> + test_cmp expect actual &&
> +
> + layer="$(head -n 1 $repo/$chain)" &&
> + cat >expect.err <<-EOF &&
> + warning: disabling Bloom filters for commit-graph layer $SQ$layer$SQ due to incompatible settings
> + EOF
> + test_cmp expect.err err
The variable $repo is used 9 times in this test case. I think it
would be simpler and easier follow if it used a ( cd $repo && ... )
subshell, like many of the previous tests in this test script,
> +'
> +
> get_first_changed_path_filter () {
> test-tool read-graph bloom-filters >filters.dat &&
> head -n 1 filters.dat
> @@ -536,6 +563,120 @@ test_expect_success 'version 1 changed-path used when version 1 requested' '
> )
> '
>
> +test_expect_success 'version 1 changed-path not used when version 2 requested' '
> + (
> + cd highbit1 &&
> + git config --add commitgraph.changedPathsVersion 2 &&
> + test_bloom_filters_not_used "-- another$CENT"
> + )
> +'
> +
> +test_expect_success 'version 1 changed-path used when autodetect requested' '
> + (
> + cd highbit1 &&
> + git config --add commitgraph.changedPathsVersion -1 &&
> + test_bloom_filters_used "-- another$CENT"
> + )
> +'
> +
> +test_expect_success 'when writing another commit graph, preserve existing version 1 of changed-path' '
> + test_commit -C highbit1 c1double "$CENT$CENT" &&
> + git -C highbit1 commit-graph write --reachable --changed-paths &&
> + (
> + cd highbit1 &&
> + git config --add commitgraph.changedPathsVersion -1 &&
> + echo "options: bloom(1,10,7) read_generation_data" >expect &&
> + test-tool read-graph >full &&
> + grep options full >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> +test_expect_success 'set up repo with high bit path, version 2 changed-path' '
> + git init highbit2 &&
> + git -C highbit2 config --add commitgraph.changedPathsVersion 2 &&
> + test_commit -C highbit2 c2 "$CENT" &&
> + git -C highbit2 commit-graph write --reachable --changed-paths
> +'
> +
> +test_expect_success 'check value of version 2 changed-path' '
> + (
> + cd highbit2 &&
> + echo "c01f" >expect &&
> + get_first_changed_path_filter >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> +test_expect_success 'setup make another commit' '
> + # "git log" does not use Bloom filters for root commits - see how, in
> + # revision.c, rev_compare_tree() (the only code path that eventually calls
> + # get_bloom_filter()) is only called by try_to_simplify_commit() when the commit
> + # has one parent. Therefore, make another commit so that we perform the tests on
> + # a non-root commit.
> + test_commit -C highbit2 anotherc2 "another$CENT"
> +'
> +
> +test_expect_success 'version 2 changed-path used when version 2 requested' '
> + (
> + cd highbit2 &&
> + test_bloom_filters_used "-- another$CENT"
> + )
> +'
> +
> +test_expect_success 'version 2 changed-path not used when version 1 requested' '
> + (
> + cd highbit2 &&
> + git config --add commitgraph.changedPathsVersion 1 &&
> + test_bloom_filters_not_used "-- another$CENT"
> + )
> +'
> +
> +test_expect_success 'version 2 changed-path used when autodetect requested' '
> + (
> + cd highbit2 &&
> + git config --add commitgraph.changedPathsVersion -1 &&
> + test_bloom_filters_used "-- another$CENT"
> + )
> +'
> +
> +test_expect_success 'when writing another commit graph, preserve existing version 2 of changed-path' '
> + test_commit -C highbit2 c2double "$CENT$CENT" &&
> + git -C highbit2 commit-graph write --reachable --changed-paths &&
> + (
> + cd highbit2 &&
> + git config --add commitgraph.changedPathsVersion -1 &&
> + echo "options: bloom(2,10,7) read_generation_data" >expect &&
> + test-tool read-graph >full &&
> + grep options full >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> +test_expect_success 'when writing commit graph, do not reuse changed-path of another version' '
> + git init doublewrite &&
> + test_commit -C doublewrite c "$CENT" &&
> + git -C doublewrite config --add commitgraph.changedPathsVersion 1 &&
> + git -C doublewrite commit-graph write --reachable --changed-paths &&
> + for v in -2 3
> + do
> + git -C doublewrite config --add commitgraph.changedPathsVersion $v &&
> + git -C doublewrite commit-graph write --reachable --changed-paths 2>err &&
> + cat >expect <<-EOF &&
> + warning: attempting to write a commit-graph, but ${SQ}commitgraph.changedPathsVersion${SQ} ($v) is not supported
> + EOF
> + test_cmp expect err || return 1
> + done &&
> + git -C doublewrite config --add commitgraph.changedPathsVersion 2 &&
> + git -C doublewrite commit-graph write --reachable --changed-paths &&
The path 'doublewrite' is used 8 times in this test case before
finally cd-ing into that directory in a subshell...
> + (
> + cd doublewrite &&
> + echo "c01f" >expect &&
> + get_first_changed_path_filter >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> corrupt_graph () {
> test_when_finished "rm -rf $graph" &&
> git commit-graph write --reachable --changed-paths &&
> --
> 2.43.0.509.g253f65a7fc
>
next prev parent reply other threads:[~2024-02-25 22:15 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 22:52 [PATCH v6 00/16] bloom: changed-path Bloom filters v2 (& sundries) Taylor Blau
2024-01-31 22:52 ` [PATCH v6 01/16] t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()` Taylor Blau
2024-01-31 22:52 ` [PATCH v6 02/16] revision.c: consult Bloom filters for root commits Taylor Blau
2024-01-31 22:52 ` [PATCH v6 03/16] commit-graph: ensure Bloom filters are read with consistent settings Taylor Blau
2024-01-31 22:52 ` [PATCH v6 04/16] gitformat-commit-graph: describe version 2 of BDAT Taylor Blau
2024-01-31 22:52 ` [PATCH v6 05/16] t/helper/test-read-graph.c: extract `dump_graph_info()` Taylor Blau
2024-01-31 22:52 ` [PATCH v6 06/16] bloom.h: make `load_bloom_filter_from_graph()` public Taylor Blau
2024-01-31 22:52 ` [PATCH v6 07/16] t/helper/test-read-graph: implement `bloom-filters` mode Taylor Blau
2024-01-31 22:52 ` [PATCH v6 08/16] t4216: test changed path filters with high bit paths Taylor Blau
2024-01-31 22:52 ` [PATCH v6 09/16] repo-settings: introduce commitgraph.changedPathsVersion Taylor Blau
2024-01-31 22:52 ` [PATCH v6 10/16] bloom: annotate filters with hash version Taylor Blau
2024-01-31 22:52 ` [PATCH v6 11/16] bloom: prepare to discard incompatible Bloom filters Taylor Blau
2024-01-31 22:52 ` [PATCH v6 12/16] commit-graph: unconditionally load " Taylor Blau
2024-01-31 22:52 ` [PATCH v6 13/16] commit-graph: new Bloom filter version that fixes murmur3 Taylor Blau
2024-02-25 22:15 ` SZEDER Gábor [this message]
2024-02-28 0:11 ` Jiang Xin
2024-01-31 22:52 ` [PATCH v6 14/16] object.h: fix mis-aligned flag bits table Taylor Blau
2024-01-31 22:52 ` [PATCH v6 15/16] commit-graph: reuse existing Bloom filters where possible Taylor Blau
2024-01-31 22:53 ` [PATCH v6 16/16] bloom: introduce `deinit_bloom_filters()` Taylor Blau
2024-06-25 17:39 ` [PATCH v7 00/16] bloom: changed-path Bloom filters v2 (& sundries) Taylor Blau
2024-06-25 17:39 ` [PATCH v7 01/16] t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()` Taylor Blau
2024-06-25 17:39 ` [PATCH v7 02/16] revision.c: consult Bloom filters for root commits Taylor Blau
2024-06-25 17:39 ` [PATCH v7 03/16] commit-graph: ensure Bloom filters are read with consistent settings Taylor Blau
2024-06-25 17:39 ` [PATCH v7 04/16] gitformat-commit-graph: describe version 2 of BDAT Taylor Blau
2024-06-25 17:39 ` [PATCH v7 05/16] t/helper/test-read-graph.c: extract `dump_graph_info()` Taylor Blau
2024-06-25 17:39 ` [PATCH v7 06/16] bloom.h: make `load_bloom_filter_from_graph()` public Taylor Blau
2024-06-25 17:39 ` [PATCH v7 07/16] t/helper/test-read-graph: implement `bloom-filters` mode Taylor Blau
2024-06-25 17:39 ` [PATCH v7 08/16] t4216: test changed path filters with high bit paths Taylor Blau
2024-06-25 17:39 ` [PATCH v7 09/16] repo-settings: introduce commitgraph.changedPathsVersion Taylor Blau
2024-06-25 17:39 ` [PATCH v7 10/16] bloom: annotate filters with hash version Taylor Blau
2024-06-25 17:39 ` [PATCH v7 11/16] bloom: prepare to discard incompatible Bloom filters Taylor Blau
2024-06-25 17:40 ` [PATCH v7 12/16] commit-graph: unconditionally load " Taylor Blau
2024-06-25 17:40 ` [PATCH v7 13/16] commit-graph: new Bloom filter version that fixes murmur3 Taylor Blau
2024-06-25 17:40 ` [PATCH v7 14/16] object.h: fix mis-aligned flag bits table Taylor Blau
2024-06-25 17:40 ` [PATCH v7 15/16] commit-graph: reuse existing Bloom filters where possible Taylor Blau
2024-06-25 17:40 ` [PATCH v7 16/16] bloom: introduce `deinit_bloom_filters()` Taylor Blau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240225221524.GA1940392@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@google.com \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.