Skip to content
Snippets Groups Projects
  1. Feb 21, 2025
  2. Feb 07, 2025
    • Mitchell Kember's avatar
      rust: add GraphError::ParentOutOfOrder · 2fb13c3f4496
      Mitchell Kember authored
      This will be used in a follow-up commit that creates a data structure optimized
      for inserting revisions in descending order, since it will need to fail if a
      revision number is greater than its descendant (meaning the graph is corrupted).
      2fb13c3f4496
  3. Jan 16, 2025
  4. Jan 14, 2025
  5. Jan 03, 2025
  6. Nov 26, 2024
  7. Oct 29, 2024
  8. Sep 26, 2024
  9. Aug 01, 2024
  10. Jul 31, 2024
  11. Jul 29, 2024
    • Raphaël Gomès's avatar
      hg-core: add a complete VFS · 7be39c5110c9
      Raphaël Gomès authored
      This will be used from Python in a later change.
      
      More changes are needed in hg-core and rhg to properly clean up the APIs
      of the old VFS implementation but it can be done when the dust settles
      and we start adding more functionality to the pure Rust VFS.
      7be39c5110c9
  12. Sep 26, 2024
  13. Oct 10, 2024
    • Raphaël Gomès's avatar
      rust-revlog: add a Rust-only `InnerRevlog` · e01e84e5e426
      Raphaël Gomès authored
      This mirrors the Python `InnerRevlog` and will be used in a future patch
      to replace said Python implementation. This allows us to start doing more
      things in pure Rust, in particular reading and writing operations.
      
      A lot of changes have to be introduced all at once, it wouldn't be very
      useful to separate this patch IMO since all of them are either interlocked
      or only useful with the rest.
      e01e84e5e426
  14. Sep 25, 2024
  15. Oct 01, 2024
    • Raphaël Gomès's avatar
      update: add a Rust fast-path when updating from null (and clean) · 8b7123c8947b
      Raphaël Gomès authored
      This case is easy to detect and we have all we need to generate a valid
      working copy and dirstate entirely in Rust, which speeds things up
      considerably:
      
      On my machine updating a repo of ~300k files goes from 10.00s down to 4.2s,
      all while consuming 50% less system time, with all caches hot.
      Something to note is that further improvements will probably happen
      with the upcoming `InnerRevlog` series that does smarter
      mmap hanlding, especially for filelogs.
      
      Here are benchmark numbers on a machine with only 4 cores (and no SMT enabled)
      
      ```
      ### data-env-vars.name               = heptapod-public-2024-03-25-ds2-pnm
        # benchmark.name                   = hg.command.update
        # bin-env-vars.hg.py-re2-module    = default
        # bin-env-vars.hg.changeset.node   = <this change>
        # benchmark.variants.atomic-update = no
        # benchmark.variants.scenario      = null-to-tip
        # benchmark.variants.worker        = default
      default: 5.328762  ~~~~~
      rust: 1.308654  (-75.44%, -4.02)
      ### data-env-vars.name               = mercurial-devel-2024-03-22-ds2-pnm
        # benchmark.name                   = hg.command.update
        # bin-env-vars.hg.py-re2-module    = default
        # bin-env-vars.hg.changeset.node   = <this change>
        # benchmark.variants.atomic-update = no
        # benchmark.variants.scenario      = null-to-tip
        # benchmark.variants.worker        = default
      default: 1.693271  ~~~~~
      rust: 1.151053  (-32.02%, -0.54)
      ### data-env-vars.name               = mozilla-unified-2024-03-22-ds2-pnm
        # benchmark.name                   = hg.command.update
        # bin-env-vars.hg.py-re2-module    = default
        # bin-env-vars.hg.changeset.node   = <this change>
        # benchmark.variants.atomic-update = no
        # benchmark.variants.scenario      = null-to-tip
        # benchmark.variants.worker        = default
      default: 38.901613  ~~~~~
      rust: 11.637880 (-70.08%, -27.26)
      ### data-env-vars.name               = netbsd-xsrc-public-2024-09-19-ds2-pnm
        # benchmark.name                   = hg.command.update
        # bin-env-vars.hg.py-re2-module    = default
        # bin-env-vars.hg.changeset.node   = <this change>
        # benchmark.variants.atomic-update = no
        # benchmark.variants.scenario      = null-to-tip
        # benchmark.variants.worker        = default
      default: 4.793727  ~~~~~
      rust: 1.505905  (-68.59%, -3.29)
      ```
      8b7123c8947b
    • Raphaël Gomès's avatar
      rust: improve `InvalidRevision` error message · 652149ed64f0
      Raphaël Gomès authored
      I encountered this when debugging earlier and felt like we were losing some
      information along the way, which we were!
      652149ed64f0
  16. Jun 19, 2024
  17. Sep 17, 2024
  18. Jun 19, 2024
  19. May 06, 2024
  20. Apr 22, 2024
    • Georges Racinet's avatar
      rust: blanket implementation of Graph for Graph references · b08c5fbe0e70
      Georges Racinet authored
      The need comes from the fact that `AncestorsIterator` and many
      Graph-related algorithms take ownership of the `Graph` they work with.
      This, in turn is due to them needing to accept the `Index` instances
      that are provided by the Python layers (that neither rhg nor `RHGitaly`
      use, of course): the fact that nowadays the Python layer holds an object
      that is itself implemented in Rust does not change the core problem that
      they cannot be tracked by the borrow checker.
      
      Even though it looks like cloning `Changelog` would be cheap, it seems
      hard to guarantee that on the long run. The object is already too rich
      for us to be comfortable with it, when using references is the most
      natural and guaranteed way of proceeding.
      
      The added test seems a bit superfleous, but it will act as a reminder
      that this feature is really useful until something in the Mercurial code
      base actually uses it.
      b08c5fbe0e70
  21. Feb 26, 2024
  22. Nov 23, 2023
  23. Nov 02, 2023
  24. Sep 18, 2023
  25. Nov 06, 2023
    • Raphaël Gomès's avatar
      rust: run a clippy pass with the latest stable version · 532e74ad3ff6
      Raphaël Gomès authored
      Our current version of clippy is older than the latest stable.
      The newest version has new lints that are moslty good advice, so let's apply
      them ahead of time. This has the added benefit of reducing the noise for
      developpers like myself that use clippy as an IDE helper, as well as being
      more prepared for a future clippy upgrade.
      532e74ad3ff6
  26. Oct 11, 2023
  27. Sep 14, 2023
  28. Sep 13, 2023
  29. Aug 18, 2023
    • Raphaël Gomès's avatar
      rust: make `Revision` a newtype · 4c5f6e95df84
      Raphaël Gomès authored
      This change is the one we've been building towards during this series.
      The aim is to make `Revision` mean more than a simple integer, holding
      the information that it is valid for a given revlog index.
      While this still allows for programmer error, since creating a revision
      directly and querying a different index with a "checked" revision are
      still possible, the friction created by the newtype will hopefully make
      us think twice about which type to use.
      
      Enough of the Rust ecosystem relies on the newtype pattern to be
      efficiently optimized away (even compiler in codegen tests¹), so I'm not
      worried about this being a fundamental problem.
      
      [1] https://github.com/rust-lang/rust/blob/7a70647f195f6b0a0f1ebd72b1542ba91a32f43a/tests/codegen/vec-in-place.rs#L47
      4c5f6e95df84
  30. Aug 10, 2023
    • Raphaël Gomès's avatar
      rust: implement the `Graph` trait for all revlogs · 27e773aa607d
      Raphaël Gomès authored
      This is trivial and makes all the algorithms relying on the trait usable
      for more use cases.
      27e773aa607d
    • Raphaël Gomès's avatar
      rust: use the new `UncheckedRevision` everywhere applicable · 1928b770e3e7
      Raphaël Gomès authored
      This step converts all revisions that shouldn't be considered "valid" in any
      context to `UncheckedRevison`, allowing `Revision` to be changed for a
      stronger type in a later changeset.
      
      Note that the conversion from unchecked to checked is manual and requires
      at least some thought from the programmer, although directly using `Revision`
      is still possible. A later changeset will make this mistake harder to make.
      1928b770e3e7
  31. Sep 11, 2023
  32. Aug 07, 2023
    • Raphaël Gomès's avatar
      rust: remove unused error variant · 3aca98a35727
      Raphaël Gomès authored
      All paths check that the working directory revision is not used.
      3aca98a35727
    • Raphaël Gomès's avatar
      rust: add `UncheckedRevision` type · c950fdba7472
      Raphaël Gomès authored
      This is the start of a series whose aim is to separate "checked" and
      "unchecked" revision numbers. A "checked" revision number is valid for a given
      index, allowing us to have faster algorithms that don't do redundant checks
      all the time and have a clearer view of the kinds of revisions
      we're working with.
      c950fdba7472
Loading