Skip to content

Conversation

@skaunov
Copy link
Member

@skaunov skaunov commented Apr 17, 2025

This stems from #543 but focuses on the different aspect. It would not be much reasonable to change a function because of a test, but I looked into itself and that seems it only benefits from switching, as this improves find. (The proptest benefits by the determinism of BTreeMap.)

skaunov added a commit to skaunov/neptune-core that referenced this pull request Apr 17, 2025
@aszepieniec
Copy link
Contributor

Can you be more specific about what is improved? In general, accesses in a binary tree map take $O(\log n)$ whereas accesses in a hash map take $O(1)$ time, so I'd like to understand the apparent performance improvement properly before approving this PR.

@skaunov
Copy link
Member Author

skaunov commented Apr 17, 2025

@aszepieniec
My intuition was that both partition and find operations in split_by_activity do in essence an u64 comparison so finding the correct root in a tree or checking the right most leaf should be easier than going over all the .keys() arbitrary. But that's just intuition of mine; I didn't dig for an evidence. 🙊

@aszepieniec
Copy link
Contributor

Let's collect evidence so that we do not have to rely on intuition to determine whether merging this PR is a good idea.

Or we can file this PR under "too low priority for now" and shelve it until we need it.

@skaunov
Copy link
Member Author

skaunov commented Apr 20, 2025 via email

@aszepieniec
Copy link
Contributor

Sounds good to me. I can redo it with .last() instead of .find and
a range set instead of partition to make retrieval benefit obvious.
Indicate if you would want to merge it then, pls.

I don't know, it's not obvious before I can see the code. I can only pass judgment afterwards.

I'm happy shelving this discussion until it is clear we need this particular thing to be faster. I have a hunch that other things are much more deserving of our attention when it comes to optimization.

@aszepieniec
Copy link
Contributor

Closed: shelved indefinitely.

skaunov added a commit to skaunov/neptune-core that referenced this pull request Apr 25, 2025
return the <.gitignore> change

Revert "initial approach"

This reverts commit f5f4b66.

the second approach

impacting a cached/deterministic/derandomized test

align with the review comments

replace `TestRunner` with some proper invocations

replacing more `TestRunner`

couple of strategies on `ChunkDictionary`

`TransactionKernel` strategies

`prop_compose!` `Utxo`

add `Seed` and ditch `rng` invocations from block faking helpers

it isn't meaningful to fuzz randomness

`tests::shared` doesn't generate it's own randomness anymore

last place of randomness in `tests::shared` ditched

semantically finished

ready for review

ditch #proofs_presaved_compat

Update src/models/state/wallet/secret_key_material.rs

Co-authored-by: aszepieniec <[email protected]>

the comment on the `prop_assume` for seeds

an import unmerge

ditch a temp binding

propose solution for `Hash`-based collections in `proptest`

expand the proposal to the place where the discussion is

changes are moved into Neptune-Crypto#554

finilize `catch_inconsistent_shares`

remove few commented out lines

consistent naming
skaunov added a commit to skaunov/neptune-core that referenced this pull request Apr 27, 2025
return the <.gitignore> change

Revert "initial approach"

This reverts commit f5f4b66.

the second approach

impacting a cached/deterministic/derandomized test

align with the review comments

replace `TestRunner` with some proper invocations

replacing more `TestRunner`

couple of strategies on `ChunkDictionary`

`TransactionKernel` strategies

`prop_compose!` `Utxo`

add `Seed` and ditch `rng` invocations from block faking helpers

it isn't meaningful to fuzz randomness

`tests::shared` doesn't generate it's own randomness anymore

last place of randomness in `tests::shared` ditched

semantically finished

ready for review

ditch #proofs_presaved_compat

Update src/models/state/wallet/secret_key_material.rs

Co-authored-by: aszepieniec <[email protected]>

the comment on the `prop_assume` for seeds

an import unmerge

ditch a temp binding

propose solution for `Hash`-based collections in `proptest`

expand the proposal to the place where the discussion is

changes are moved into Neptune-Crypto#554

finilize `catch_inconsistent_shares`

remove few commented out lines

consistent naming
skaunov added a commit to skaunov/neptune-core that referenced this pull request Jun 12, 2025
return the <.gitignore> change

Revert "initial approach"

This reverts commit f5f4b66.

the second approach

impacting a cached/deterministic/derandomized test

align with the review comments

replace `TestRunner` with some proper invocations

replacing more `TestRunner`

couple of strategies on `ChunkDictionary`

`TransactionKernel` strategies

`prop_compose!` `Utxo`

add `Seed` and ditch `rng` invocations from block faking helpers

it isn't meaningful to fuzz randomness

`tests::shared` doesn't generate it's own randomness anymore

last place of randomness in `tests::shared` ditched

semantically finished

ready for review

ditch #proofs_presaved_compat

Update src/models/state/wallet/secret_key_material.rs

Co-authored-by: aszepieniec <[email protected]>

the comment on the `prop_assume` for seeds

an import unmerge

ditch a temp binding

propose solution for `Hash`-based collections in `proptest`

expand the proposal to the place where the discussion is

changes are moved into Neptune-Crypto#554

finilize `catch_inconsistent_shares`

remove few commented out lines

consistent naming

reflect in the name that "the chunk indices are
independent of the absolute index set"

fix staling of some tests
skaunov added a commit to skaunov/neptune-core that referenced this pull request Jun 14, 2025
return the <.gitignore> change

Revert "initial approach"

This reverts commit f5f4b66.

the second approach

impacting a cached/deterministic/derandomized test

align with the review comments

replace `TestRunner` with some proper invocations

replacing more `TestRunner`

couple of strategies on `ChunkDictionary`

`TransactionKernel` strategies

`prop_compose!` `Utxo`

add `Seed` and ditch `rng` invocations from block faking helpers

it isn't meaningful to fuzz randomness

`tests::shared` doesn't generate it's own randomness anymore

last place of randomness in `tests::shared` ditched

semantically finished

ready for review

ditch #proofs_presaved_compat

Update src/models/state/wallet/secret_key_material.rs

Co-authored-by: aszepieniec <[email protected]>

the comment on the `prop_assume` for seeds

an import unmerge

ditch a temp binding

propose solution for `Hash`-based collections in `proptest`

expand the proposal to the place where the discussion is

changes are moved into Neptune-Crypto#554

finilize `catch_inconsistent_shares`

remove few commented out lines

consistent naming

reflect in the name that "the chunk indices are
independent of the absolute index set"

fix staling of some tests

rebase adaptation
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.

2 participants