From aec29db6aaa214890e20c1d39abea6f5809b1755 Mon Sep 17 00:00:00 2001 From: Krill Date: Sun, 6 Sep 2026 20:26:21 -0500 Subject: [PATCH] fix(test): classify MSan harness canaries and report unavailable instrumentation as skipped --- Tests/TestMSanCanary.cpp | 8 ++++---- Tools/test_source_census.py | 7 ++++++- wiki/advanced/Codebase-Statistics.md | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Tests/TestMSanCanary.cpp b/Tests/TestMSanCanary.cpp index 6b70139e9..fec44b89a 100644 --- a/Tests/TestMSanCanary.cpp +++ b/Tests/TestMSanCanary.cpp @@ -9,8 +9,8 @@ * representation written by the out-of-line basic_string::__init stays * poisoned and __msan_test_shadow returns >= 0; with the instrumented runtime * it returns -1. No uninitialised value is read here, so halt_on_error is - * irrelevant. In every other build the tests are count-preserving stubs - * (same pattern as TestVulkanLavapipe.cpp). + * irrelevant. In every other build the tests explicitly skip: registration + * alone is not evidence that MemorySanitizer instrumentation was verified. */ #include "TestFramework.h" @@ -39,7 +39,7 @@ TEST(MSanCanary_TestTranslationUnitIsInstrumented) probe = 1; EXPECT_EQ(__msan_test_shadow(&probe, sizeof probe), -1); #else - EXPECT_TRUE(true); + SKIP_TEST("MemorySanitizer instrumentation is unavailable in this build"); #endif } @@ -57,6 +57,6 @@ TEST(MSanCanary_LibcxxStoresUpdateShadow) EXPECT_EQ(__msan_test_shadow(onHeap.get(), sizeof(std::string)), -1); EXPECT_EQ(__msan_test_shadow(onHeap->data(), onHeap->size()), -1); #else - EXPECT_TRUE(true); + SKIP_TEST("MemorySanitizer instrumentation is unavailable in this build"); #endif } diff --git a/Tools/test_source_census.py b/Tools/test_source_census.py index 4469ea490..d7b6c6148 100644 --- a/Tools/test_source_census.py +++ b/Tools/test_source_census.py @@ -53,7 +53,12 @@ # ...which leaves the files whose SUBJECT is the harness. Includes alone cannot # distinguish those, so they are named here. -HARNESS_TESTS = frozenset({"Tests/TestRunnerSemanticsReal.cpp"}) +HARNESS_TESTS = frozenset({ + "Tests/TestRunnerSemanticsReal.cpp", + # Verifies the sanitizer harness and instrumented C++ runtime, not a + # test-local copy of engine behavior. Non-MSan builds explicitly skip it. + "Tests/TestMSanCanary.cpp", +}) # A file with no production header still exercises production code if it drives # a shipped executable and asserts on the result. diff --git a/wiki/advanced/Codebase-Statistics.md b/wiki/advanced/Codebase-Statistics.md index f3eed6c87..f9c77f825 100644 --- a/wiki/advanced/Codebase-Statistics.md +++ b/wiki/advanced/Codebase-Statistics.md @@ -1,6 +1,6 @@ # Codebase Statistics -Comprehensive metrics and analysis of the SparkEngine codebase. Updated 2026-09-06. +Comprehensive metrics and analysis of the SparkEngine codebase. Updated 2026-09-07. This source inventory is not readiness evidence. The `stable-v1` Windows 11 x64 profile remains blocked and uncertified in `docs/site/readiness.json`.