Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variable block sizes in the LRU stack #93

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

thedavidchu
Copy link
Owner

@thedavidchu thedavidchu commented Oct 23, 2024

  • I don't understand what's going on in the splay tree code well enough to rewrite it to incorporate this.
    • At first, the reason was that I'm trying to infer the weight of nodes from the structure rather than just storing this weight explicitly.
    • I fixed this but it is now broken in that state. Run meson test debug_tree_test to see the brokenness

The (anonymized) Meson test output is here:

Log of Meson test suite run on 2024-10-23T16:56:19.390647

==================================== 1/1 =====================================
test:         debug_tree_test
start time:   16:56:19
duration:     0.00s
result:       exit status 1
command:      ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=79 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 
----------------------------------- stdout -----------------------------------
Key: 92, Size: 92
---
  Key: 92, Size: 31
Key: 31, Size: 62
---
[ERROR] [2024-10-23 16:56:19] [ ../src/lib/tree/basic_tree.c:349 ] [errno 0: Success] mismatching cardinalities: 31 vs 61
[ERROR] ../src/lib/tree/basic_tree.c:399
[ERROR] [2024-10-23 16:56:19] [ ../test/lib_test/tree_test/debug_tree_test.c:36 ] [errno 0: Success] validation failed
==============================================================================


Summary of Failures:

1/1 debug_tree_test FAIL            0.00s   exit status 1

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

The tree should look like:

  Key: 92, Size: 92
Key: 31, Size: 123
  • I think this will negatively impact performance because it will either require larger memory sizes (to include the size of each specific object) or will require me to access more nodes (to find the weight of the current node)

@thedavidchu thedavidchu force-pushed the main branch 2 times, most recently from 7751c67 to 8ca19b7 Compare October 29, 2024 13:33
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.

1 participant