i#6712 record bounds: Add record filter sanity checks #6749
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds two sanity checks developed to identify what was at first believed to be a new bug but turned out to be #6712:
Ensure that last_encoding is empty on an input switch, to avoid recording the wrong encoding in pc2encoding.
Ensure the encoding size matches the instr size when inserting chunk-new encodings.
Augment the reader check for mismatching encoding vs instr sizes, and abort in release build too.
Although #6712 is fixed, these checks are still useful to prevent regressions. Plus, the reader_t check detects other bugs as well and we know at least one other is out there in #6303. Making the reader check abort in release build should help avoid wasted work as already happened here where we didn't notice the printed warnings in release build.
Tested by running record_filter on large proprietary inputs: no checks failed.
Issue: #6712