- Oct 31, 2023
-
-
Raphaël Gomès authored
We don't have any stats in the Rust index. Currently it is not known which stats would be interesting to get, so if they end up being important, we can add them later.
-
Raphaël Gomès authored
This makes `test-verify.t` pass again. In an ideal world, we would find the exact commit where this test breaks and amend part of this change there, but this is a long enough series.
-
Raphaël Gomès authored
This is only relevant for Python code and the SQLite backend, which is in a half-abandoned state.
-
- Oct 20, 2023
-
-
Georges Racinet authored
This is expected to be by far the most common case, given that, e.g., merging involves using it on two revisions. Using a `u8` as support for the bitset obviously divides the amount of RAM needed by 8. To state the obvious, on a repository with 10 million changesets, this spares 70MB. It is also possible that it'd be slightly faster, because it is easier to allocate and provides better cache locality. It is possible that some exhaustive listing of the traits implemented by `u8` and `u64` would avoid the added duplication, but that can be done later and would need a replacement for the `MAX` consts.
-
Georges Racinet authored
`parent_seen` can be made a mutable ref, making this part more obvious, not needing to be commented so much. The micro-optimization of avoiding the union if `parent_seen` and `current_seen` agree is pushed down in the `union()` method of the fast, `u64` based bit set implementation (in case it matters).
-
Georges Racinet authored
-
Georges Racinet authored
Instead of keeping the information whether the current revision is poisoned on `current_seen`, we extract it as a boolean. This also allows us to simplify the explanation of `seen[r].is_poisoned()`, as the exceptional case where it is poisoned right after `r` has been determined to be a solution does no longer exist.
-
- Oct 18, 2023
-
-
Georges Racinet authored
The only differences betwwen `common_ancestors_heads()` and `find_gca_candidates()` seems to be that: - the former accepts "overlapping" input revisions (meaning with duplicates). - limitation to 24 inputs (in the C code), that we translate to using the arbitrary size bit sets in the Rust code because we cannot bail to Python. Given that the input is expected to be small in most cases, we take the heavy handed approach of going through a HashSet and wait for perfomance assessment In case this is used via `hg-cpython`, we can anyway absorb the overhead by having `commonancestorheads` build a vector of unique values directly, and introduce a thin wrapper over `find_gca_candidates`, to take care of bit set type dispatching only. As far as `ancestors` is concerneed, this is just chaining `common_ancestors_heads()` with `find_deepest_revs`.
-
- Oct 17, 2023
-
-
Georges Racinet authored
This allows to use arbitratry size of inputs in `find_gca_candidates()`. We're genericizing so that the common case of up to 63 inputs can be treated with the efficient implementation backed by `u64`. Some complications with the borrow checker came, because arbitrary sized bit sets will not be `Copy`, hence mutating them keeps a mut ref on the `seen` vector. This is solved by some cloning, most of which can be avoided, preferably in a follow-up after proof that this works (hence after exposition to Python layer). As far as performance is concerned, calling `clone()` on a `Copy` object (good case when number of revs is less than 64) should end up just doing a copy, according to this excerpt of the `Clone` trait documentation: Types that are Copy should have a trivial implementation of Clone. More formally: if T: Copy, x: T, and y: &T, then let x = y.clone(); is equivalent to let x = *y;. Manual implementations should be careful to uphold this invariant; however, unsafe code must not rely on it to ensure memory safety. We kept the general structure, hence why there are some double negations. This also could be made nicer in a follow-up. The `NonStaticPoisonableBitSet` is included to ensure that the `PoisonableBitSet` trait is general enough (had to correct `vec_of_empty()` for instance). Moving the genericization one level to encompass the `seen` vector and not its elements would be better for performance, if worth it.
-
- Nov 02, 2023
-
-
Raphaël Gomès authored
This still follows closely the C original and not able to treat more than 63 input revisions (bitset backed by `u64` and one bit reserved for poisoning).
-
- Oct 30, 2023
-
-
Raphaël Gomès authored
Exposition in `hg-cpython` done in regular impl block, again for rustfmt support etc.
-
- Nov 02, 2023
-
-
Georges Racinet authored
It will be useful to give callers the control on the generated errors
-
- Oct 30, 2023
-
-
Raphaël Gomès authored
Exposition in `hg-cpython` done in the regular `impl` block to enjoy rustfmt and clearer compilartion errors.
-
- Sep 30, 2023
-
-
Georges Racinet authored
Ready for removal of the scaffolding. This time, we allow ourselves a minor optimization: we avoid allocating for each chunk. Instead, we reuse the same vector, and perform at most one allocation per chunk. The `PyList` constructor will copy the buffer anyway.
-
- Nov 02, 2023
-
-
Raphaël Gomès authored
-
- Sep 29, 2023
-
-
Georges Racinet authored
-
- Oct 30, 2023
-
-
Raphaël Gomès authored
The implementation is merged with that of `headrevs` also to make sure that caches are up to date.
-
- Sep 19, 2023
-
-
Raphaël Gomès authored
-
- Sep 30, 2023
-
-
Georges Racinet authored
The example given in doc-comment is the main use case: some methods may require ordering insensitive comparison. This is about to be used for `reachableroots2`
-
- Aug 03, 2023
-
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
- Aug 02, 2023
-
-
Raphaël Gomès authored
-
- Aug 03, 2023
-
-
Raphaël Gomès authored
This was an oversight, it was never a problem because we didn't use the index much for user-facing things in the past, which is the only real way of getting to this edge case.
-
- Aug 02, 2023
-
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
- Oct 30, 2023
-
-
Georges Racinet authored
-
- Nov 02, 2023
-
-
Raphaël Gomès authored
Although the removed panic tends to prove if the full test suite did pass that the case when the input is a node id does not happen, it is best not to remove it right now. Raising IndexError is crucial for iteration on the index to stop, given the default CPython sequence iterator, see for instance https://github.com/zpoint/CPython-Internals/blobs/master/BasicObject/iter/iter.md This was spotted by `test-rust-ancestors.py`, which does simple interations on indexes (as preflight checks). In `revlog.c`, `index_getitem` defaults to `index_get` when called on revision numbers, which does raise `IndexError` with the same message as the one we are introducing here.
-
- Sep 27, 2023
-
-
Georges Racinet authored
-
- Nov 02, 2023
-
-
Raphaël Gomès authored
This is a temporary measure to show that both the Rust and C indexes are kept in sync. Comes with some related documentation precisions. For comparison of error cases, see `index_entry_binary()` in `revlog.c`.
-
- Sep 30, 2023
-
-
Georges Racinet authored
To help knowing at a glance when a method is ready, making us more comofortable when we are close to the final removal of scaffolding, we introduce the systematic variable names `rust_res` and `c_res`. The goal of this series is to always return the formet. We take again the case of `pack_header` as example. Our personal opinion is to usually avoid such poor semantics as `res`, but usually accept it when it close to the actual return, which will be the case in most methods of this series. Also, the name can simply be dropped when we remove the scaffolding. To follow on the example, the body of `pack_header()` should become this in the final version: ``` let index = self.index(py).borrow(); let packed = index.pack_header(args.get_item(py, 0).extract(py)?); Ok(PyBytes::new(py, &packed).into_object()); ``` in these cases it is close to the actual return and will be removed at the end entirely.
-
- Sep 29, 2023
-
-
Georges Racinet authored
This is a bit simpler to call and has the advantage of systematically log the encountered deviation. To avoid committing dead code, we apply it to the `pack_header` method, that was already returning the Rust result.
-
- Sep 27, 2023
-
-
Georges Racinet authored
This is a good match for exceptions raised from the C implementation, when it is not about a nodemap inconsistency.
-
- Oct 18, 2023
-
-
Georges Racinet authored
The function name was misleading, as the error wording mentions the nodemap, hence would not be appropriate for missing revisions not related to a nodemap lookup.
-
- Aug 03, 2023
-
-
Raphaël Gomès authored
-
- Oct 30, 2023
-
-
Raphaël Gomès authored
I'm not 100% sure how useful it is outside of perf, but it's still worth implementing.
-
- Jun 29, 2023
-
-
Raphaël Gomès authored
This is a temporary safeguard while we synchronize both indexes.
-
- Jun 28, 2023
-
-
Raphaël Gomès authored
Future steps will bring the two indexes further together until we can rip the C index entirely when running Rust code.
-
Raphaël Gomès authored
This is not defined on the Python or C one, and isn't used anywhere.
-
Raphaël Gomès authored
-