liveBook · Manning

Boundary check

A boundary check is a test that verifies whether a value or operation lies within an allowed range or valid data extent.

How 2 Manning books explain it

Fast Python: High performance techniques for large datasets

How it is used
Uses index guards to prevent invalid array accesses in GPU kernels and to weigh safety against speed in Cython.
How deep it goes
Explains the risk of unchecked indexing and demonstrates an extent guard, while deferring broader bounds-checking and NumPy optimizations.
Examples
Demonstrates guarding a 1,000-element array against 1,008 GPU thread positions and disabling checks for Cython image processing.
What you can do after
Apply explicit extent guards to keep excess GPU threads from accessing array positions beyond the valid range.

Read how Fast Python: High performance techniques for large datasets explains boundary check →

100 Java Mistakes and How to Avoid Them

A bounds check is a validation that an index or indexed range lies within the permitted limits of a data structure.

How it is used
Prevents invalid array, string, list, and indexed-range access before it causes exceptions or worse program behavior.
How deep it goes
Explains empty inputs, ordering errors, reversed comparisons, off-by-one errors, range constraints, and standard library checks.
Examples
Uses empty strings, array element access, offset-count ranges, and custom InputStream and List implementations.
What you can do after
Diagnose/debug with it by locating unsafe access order, reversed comparisons, and off-by-one conditions.

Read how 100 Java Mistakes and How to Avoid Them explains boundary check →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.