Skip to content

Freestanding memory bounds checker - #72

Open
danieltowner wants to merge 1 commit into
freestanding_complexfrom
freestanding_bounds_check
Open

danieltowner wants to merge 1 commit into
freestanding_complexfrom
freestanding_bounds_check

Conversation

@danieltowner

Copy link
Copy Markdown
Contributor

This new bounds checker works in free-standing mode as well as hosted. the dependency on std:string has been removed to avoid any need for runtime libraries.

@danieltowner
danieltowner added this pull request to stack #64 November 20, 2026 17:32
@danieltowner
danieltowner force-pushed the freestanding_bounds_check branch from 3e2f61b to 2f30e1c Compare November 20, 2026 17:39
@danieltowner
danieltowner removed this pull request from stack #64 November 20, 2026 17:40
@danieltowner
danieltowner added this pull request to stack #75 November 20, 2026 17:40
@omalyshe
omalyshe requested a balanced review from Copilot November 20, 2026 22:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new freestanding trap path and runtime-library independence remain untested; standalone freestanding coverage is needed for valid and fully masked accesses and trap termination on invalid access.

1 open issue
What changed in this PR

Updates SIMD memory bounds checking to support freestanding builds while preserving hosted exception diagnostics.

Changes:

  • Uses compiler traps for freestanding bounds failures and limits string-based diagnostics to hosted builds.
  • Checks selected gather/scatter indices individually, including negative indices.
  • Extends tests for diagnostic messages, mixed-sign indices, and fully masked empty ranges.
File Description
test/​TestSimdLoadStoreException.cpp Adds diagnostic and indexed-access edge-case tests.
include/​xvec/​detail/​utilities.hpp Separates hosted and freestanding failure handling and improves bounds validation.

Review effort: Balanced

Comment on lines +223 to +224
#elif defined(__GNUC__) || defined(__clang__)
__builtin_trap();
@danieltowner
danieltowner force-pushed the freestanding_bounds_check branch 2 times, most recently from a49c761 to 1d0c8f1 Compare November 21, 2026 17:34
This new bounds checker works in free-standing mode as well as hosted.
the dependency on std:string has been removed to avoid any need for
runtime libraries.
@danieltowner
danieltowner force-pushed the freestanding_bounds_check branch from 1d0c8f1 to 292c7f9 Compare November 21, 2026 17:35

This branch has not been deployed

No deployments
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.

2 participants