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

Improve testability and add tests to the way that blocks of coefficients are encoded #69

Merged
merged 18 commits into from
May 6, 2024

Conversation

mcroomp
Copy link
Collaborator

@mcroomp mcroomp commented Apr 24, 2024

add read_coefficients and write_coefficients that encapsulate the read/write process and can be testing individually without pulling in the world.

This also allows for testing with hardcoded known good values to make it easier to catch any subtle changes that could cause backwards compat issues.

@Melirius
Copy link
Collaborator

LGTM

@mcroomp
Copy link
Collaborator Author

mcroomp commented Apr 25, 2024 via email

@@ -92,17 +91,16 @@ impl ProbabilityTables {

pub fn calc_non_zero_counts_context_7x7<const ALL_PRESENT: bool>(
Copy link
Collaborator

@Melirius Melirius Apr 25, 2024

Choose a reason for hiding this comment

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

I think: what if rename this to calc_non_zero_counts_predictor_7x7 or smth like that and return num_non_zeros_above << 1, num_non_zeros_left << 1 or num_non_zeros_above + num_non_zeros_left. Then by extending array NON_ZERO_TO_BIN to 100 bytes we can reduce number of operations per coefficient.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can even return bin directly from here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll separate this in another change... better to separate refactoring from functional changes

@Melirius
Copy link
Collaborator

Nice!

mcroomp and others added 2 commits April 25, 2024 20:58
Co-authored-by: Ivan Siutsou <[email protected]>
Signed-off-by: Kristof Roomp <[email protected]>
@Melirius Melirius self-requested a review April 28, 2024 09:04
Copy link
Collaborator

@Melirius Melirius left a comment

Choose a reason for hiding this comment

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

Perfect!

@mcroomp mcroomp requested a review from gbrovman April 29, 2024 19:48
@mcroomp mcroomp merged commit ebf1837 into main May 6, 2024
3 checks passed
@mcroomp mcroomp deleted the improvetest branch May 6, 2024 18:14
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