From 77f16a16fbffb6a25c1796433dbfe1ea0dc5f8a3 Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Sun, 18 Oct 2026 02:19:30 -0500 Subject: [PATCH] state_exec test: the native-nesting stack check needs a tighter stack on macOS ApplyOnASelfContainingList expected the stack, not the 256-level count, to stop (apply apply L) on a stack 64 KiB above the reserve. An apply level is about 0.5 KiB with MSVC but under 0.25 KiB with Apple clang, so on macOS all 256 levels fit and recipe / macos-latest / Release failed after #683. The check now runs 16 KiB above the reserve. --- src/cvc/tests/state_exec_deep_data_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cvc/tests/state_exec_deep_data_test.cpp b/src/cvc/tests/state_exec_deep_data_test.cpp index b75e5b70f..2470c8929 100644 --- a/src/cvc/tests/state_exec_deep_data_test.cpp +++ b/src/cvc/tests/state_exec_deep_data_test.cpp @@ -493,8 +493,10 @@ std::size_t expect_nesting_limit(const std::string &script, std::size_t kib = kS TEST(StateExecNativeNesting, ApplyOnASelfContainingList) { // (apply apply L) with L = (apply L): apply calls itself once per trip around the cycle. const std::string loop = "(begin (set L (list apply nil)) (set-nth L 1 L) (apply apply L))"; - // On a small stack the stack left decides; on a big one, the level count. - EXPECT_LT(expect_nesting_limit(loop), kMaxNativeNesting); + // On a stack with only 16 KiB above the reserve the stack left decides, however small an apply + // level is (about 0.5 KiB with MSVC, under 0.25 KiB with Apple clang, where 64 KiB of room + // already held all 256 levels); on a big one, the level count. + EXPECT_LT(expect_nesting_limit(loop, kNativeStackReserve / 1024 + 16), kMaxNativeNesting); EXPECT_EQ(expect_nesting_limit(loop, 4096), kMaxNativeNesting); }