Skip to content

Conversation

@christian-schilling
Copy link
Member

With the addition of a notes backed cache we will have the possibility of avoiding a "cold start" by transferring just the notes to another repo. To keep the amount of extra data small the notes cache is kept sparse: Not all commits have and entry and also in shards by sequence number, as old entries are unlikely to be relevant.
The old traversal logic did not perform very well with sparse cache. Especially "find_known" proved to be a bottleneck. So the traversal is revised now to work better in the sparse cache case.

Change: cache-sparse-shards

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new :pin filter feature for Josh along with a sequence number caching optimization. The pin filter allows selective tree contents to be "held off" at parent revision versions, useful for temporarily excluding sensitive changes. The sequence number optimization improves cache efficiency by reducing the number of git notes created.

Key changes:

  • Implementation of the :pin filter that prevents appearance of selected subtrees for specific revisions
  • Addition of sequence number tracking for commits to optimize caching
  • Refactored history walking logic to use hide callbacks instead of pre-computing known commits

Reviewed Changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
josh-core/src/filter/mod.rs Added Op::Pin variant, pin filter application logic, and sequence_number handling
josh-core/src/filter/parse.rs Added parsing support for :pin filter syntax
josh-core/src/filter/opt.rs Extended filter optimization functions to handle Pin operations
josh-core/src/cache.rs Added sequence number computation and encoding/decoding functions; updated cache interface
josh-core/src/cache_notes.rs Modified to use sequence numbers for selective note storage and path partitioning
josh-core/src/cache_sled.rs Updated cache backend interface to accept sequence_number parameter
josh-core/src/cache_stack.rs Updated to propagate sequence_number through cache operations
josh-core/src/history.rs Refactored walk logic to use hide callbacks; removed find_known function
docs/src/reference/filters.md Added documentation for the :pin filter
tests/filter/*.t Updated test expectations to include sequence_number output lines
tests/filter/pin_*.t Added new test files demonstrating pin filter usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@christian-schilling christian-schilling force-pushed the @changes/master/[email protected]/cache-sparse-shards branch 7 times, most recently from d57c3f2 to a51b156 Compare November 9, 2025 13:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

With the addition of a notes backed cache we will have the
possibility of avoiding a "cold start" by transferring just
the notes to another repo. To keep the amount of extra data
small the notes cache is kept sparse: Not all commits have
and entry and also in shards by sequence number, as old
entries are unlikely to be relevant.
The old traversal logic did not perform very well with sparse
cache. Especially "find_known" proved to be a bottleneck.
So the traversal is revised now to work better in the sparse
cache case.

Change: cache-sparse-shards
@christian-schilling christian-schilling added this pull request to the merge queue Nov 9, 2025
Merged via the queue into master with commit d97b534 Nov 9, 2025
2 checks passed
@christian-schilling christian-schilling deleted the @changes/master/[email protected]/cache-sparse-shards branch November 9, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants