Skip to content

Add a function for internal validation, and use it in the fuzzer#328

Merged
Kerollmops merged 3 commits intoRoaringBitmap:mainfrom
Dr-Emann:internal_validate
Jul 5, 2025
Merged

Add a function for internal validation, and use it in the fuzzer#328
Kerollmops merged 3 commits intoRoaringBitmap:mainfrom
Dr-Emann:internal_validate

Conversation

@Dr-Emann
Copy link
Copy Markdown
Member

Fixes #197

Also adds a simd mode for the fuzzer in the hopes that it could find something like #327

@Dr-Emann
Copy link
Copy Markdown
Member Author

Dr-Emann commented Jul 1, 2025

Yep, probably found the same issue:

        FuzzInput {
            ops: [
                MutateLhs(
                    Extend(
                        [
                            Num(
                                77121,
                            ),
                            Num(
                                86957,
                            ),
                            Num(
                                77085,
                            ),
                            Num(
                                116169,
                            ),
                            Num(
                                77907,
                            ),
                            Num(
                                101677,
                            ),
                            Num(
                                72989,
                            ),
                            Num(
                                82259,
                            ),
                        ],
                    ),
                ),
                SwapSides,
                MutateLhs(
                    Extend(
                        [
                            Num(
                                130605,
                            ),
                            Num(
                                73133,
                            ),
                            Num(
                                86920,
                            ),
                            Num(
                                101677,
                            ),
                            Num(
                                82327,
                            ),
                            Num(
                                117021,
                            ),
                            Num(
                                82259,
                            ),
                            Num(
                                65536,
                            ),
                        ],
                    ),
                ),
                Binary(
                    AndNot,
                ),
            ],
            initial_input: [],
        }

@Dr-Emann
Copy link
Copy Markdown
Member Author

Dr-Emann commented Jul 1, 2025

Build is failing because a dependency updated that doesn't support 1.71.1. If we're going to pin to support an older rust version, we probably need to commit a Cargo.lock for that.

Copy link
Copy Markdown
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you for your PR again @Dr-Emann 🙏

I looked at the COBS crate, and it seems they use v1.73~1.74 std features. I'll bump the MSRV to v.1.80.1 (August 2024). I'll let you rebase once I'm done.

EDIT: PR merged with the MSRV bump. Can you rebase on main, please?

}
let mut last_end: Option<u16> = None;
for run in &self.0 {
if run.start > run.end {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we check for equality too, as the Interval is an inclusive range?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Equality should be valid (because it's an inclusive range). You can have {start:0, end:0} to have a single item in the interval.

@Dr-Emann Dr-Emann force-pushed the internal_validate branch from 6cb5cd5 to 164433f Compare July 5, 2025 15:45
@Kerollmops Kerollmops added this pull request to the merge queue Jul 5, 2025
Merged via the queue into RoaringBitmap:main with commit 5365315 Jul 5, 2025
15 checks passed
@Kerollmops
Copy link
Copy Markdown
Member

Thanks again for your work 😇

@Dr-Emann Dr-Emann deleted the internal_validate branch July 5, 2025 22:02
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.

Assert invariants

2 participants