From 3b45920991de2e9dfa5d4794db7c2a79897c7185 Mon Sep 17 00:00:00 2001 From: konard Date: Mon, 2 Feb 2026 21:08:36 +0100 Subject: [PATCH 1/8] Initial commit with task details Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/netkeep80/avm/issues/10 --- CLAUDE.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..32b3450 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,7 @@ +Issue to solve: https://github.com/netkeep80/avm/issues/10 +Your prepared branch: issue-10-544a3e00bc6f +Your prepared working directory: /tmp/gh-issue-solver-1770062911063 +Your forked repository: konard/netkeep80-avm +Original repository (upstream): netkeep80/avm + +Proceed. From e68992a1a6542c403e13d08798db61a1fded6de9 Mon Sep 17 00:00:00 2001 From: konard Date: Mon, 2 Feb 2026 21:11:35 +0100 Subject: [PATCH 2/8] Add timeout-minutes to CI jobs to prevent pipeline hanging Jobs were hanging indefinitely waiting for GitHub Actions hosted runners to become available. The default timeout is 6 hours, causing the pipeline to appear stuck. Setting timeout-minutes: 5 ensures jobs fail fast when runners are unavailable, giving clear feedback instead of hanging. Fixes #10 Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea735ca..cb81677 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ on: jobs: build: + timeout-minutes: 5 strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] @@ -46,6 +47,7 @@ jobs: run: ctest -C Release --output-on-failure lint: + timeout-minutes: 5 runs-on: ubuntu-latest steps: From 3a158a254ea0a0812ebde5c17e38d0a061842b8c Mon Sep 17 00:00:00 2001 From: konard Date: Mon, 2 Feb 2026 21:21:52 +0100 Subject: [PATCH 3/8] Merge lint steps into Linux build job to reduce runner demand The separate lint job required an additional ubuntu-latest runner, contributing to runner acquisition failures. By integrating lint checks (file size and clang-format) into the Linux build job using `if: runner.os == 'Linux'` conditions, we reduce the total number of concurrent jobs from 4 to 3, decreasing the likelihood of runner exhaustion on the free tier. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb81677..56d8b9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,29 +32,12 @@ jobs: runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Configure CMake - run: cmake -B build -DCMAKE_BUILD_TYPE=Release - - - name: Build - run: cmake --build build --config Release - - - name: Run tests - working-directory: build - run: ctest -C Release --output-on-failure - - lint: - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v4 - name: Check file sizes + if: runner.os == 'Linux' run: | MAX_LINES=1500 FAILED=0 @@ -72,8 +55,19 @@ jobs: echo "All source files are within the $MAX_LINES line limit." - name: Check formatting with clang-format + if: runner.os == 'Linux' continue-on-error: true run: | sudo apt-get install -y clang-format-17 > /dev/null 2>&1 echo "Checking formatting of source files..." find src/ include/ -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --dry-run --Werror 2>&1 || echo "::warning::Code formatting issues found. Run clang-format to fix." + + - name: Configure CMake + run: cmake -B build -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build --config Release + + - name: Run tests + working-directory: build + run: ctest -C Release --output-on-failure From 84fe4de33d34b7503ac1e71890fc1a65d2383d92 Mon Sep 17 00:00:00 2001 From: konard Date: Tue, 3 Feb 2026 02:19:18 +0100 Subject: [PATCH 4/8] Revert "Initial commit with task details" This reverts commit 3b45920991de2e9dfa5d4794db7c2a79897c7185. --- CLAUDE.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 32b3450..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,7 +0,0 @@ -Issue to solve: https://github.com/netkeep80/avm/issues/10 -Your prepared branch: issue-10-544a3e00bc6f -Your prepared working directory: /tmp/gh-issue-solver-1770062911063 -Your forked repository: konard/netkeep80-avm -Original repository (upstream): netkeep80/avm - -Proceed. From b57b3755e1cee2868d2c0bff4f11f92837dc0d79 Mon Sep 17 00:00:00 2001 From: konard Date: Tue, 3 Feb 2026 02:21:26 +0100 Subject: [PATCH 5/8] Trigger CI: verify pipeline fix after GitHub Actions outage The previous CI runs all failed due to a GitHub Actions hosted runner outage on Feb 02, 2026. Pushing empty commit to trigger a fresh CI run to verify the pipeline fix works now that the outage is resolved. Co-Authored-By: Claude Opus 4.5 From dfe8465d0b4f6982a26ea35c3e912ad6fd8b08a3 Mon Sep 17 00:00:00 2001 From: konard Date: Tue, 3 Feb 2026 02:26:29 +0100 Subject: [PATCH 6/8] Improve test reliability: clean stale output and normalize line endings - Remove stale res.json before each test run to prevent false positives when avm crashes (previous test output would incorrectly pass) - Normalize CRLF to LF in test comparison for cross-platform compatibility Co-Authored-By: Claude Opus 4.5 --- cmake/run_test.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/run_test.cmake b/cmake/run_test.cmake index 92a9c3b..2ba5a42 100644 --- a/cmake/run_test.cmake +++ b/cmake/run_test.cmake @@ -6,6 +6,12 @@ get_filename_component(TEST_NAME "${TEST_FILE}" NAME) +# Remove stale output from previous tests to avoid false positives +set(RES_FILE "${TEST_DIR}/res.json") +if(EXISTS "${RES_FILE}") + file(REMOVE "${RES_FILE}") +endif() + # Run avm on the test file from the test directory # Note: avm may return non-zero due to static destructor cleanup issues, # so we check the output file content instead of relying on exit code @@ -31,6 +37,10 @@ file(READ "${TEST_FILE}" EXPECTED_CONTENT) string(STRIP "${ACTUAL_CONTENT}" ACTUAL_CONTENT) string(STRIP "${EXPECTED_CONTENT}" EXPECTED_CONTENT) +# Normalize line endings (CRLF -> LF) for cross-platform compatibility +string(REPLACE "\r\n" "\n" ACTUAL_CONTENT "${ACTUAL_CONTENT}") +string(REPLACE "\r\n" "\n" EXPECTED_CONTENT "${EXPECTED_CONTENT}") + if(NOT "${ACTUAL_CONTENT}" STREQUAL "${EXPECTED_CONTENT}") message(FATAL_ERROR "Test ${TEST_NAME} FAILED:\nExpected: ${EXPECTED_CONTENT}\nActual: ${ACTUAL_CONTENT}") endif() From 30f0225a1982a6de2140e05114b0bca830f05255 Mon Sep 17 00:00:00 2001 From: konard Date: Tue, 3 Feb 2026 02:28:06 +0100 Subject: [PATCH 7/8] Increase Windows stack size to 8MB to fix text2.json stack overflow The avm program uses deep recursion in export_json which exceeds the default 1MB Windows stack when processing large inputs like text2.json (26,530 rel_t entities). Linux/macOS default to 8MB stack which is sufficient. Co-Authored-By: Claude Opus 4.5 --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9e244e..8ee7f3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,15 @@ if( WIN32 ) "${CMAKE_CURRENT_SOURCE_DIR}/3p" ) target_link_libraries(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3p/doublets_ffi.dll.lib" ) + # Increase stack size to 8MB on Windows (default 1MB causes stack overflow + # with deeply recursive export_json on large inputs like text2.json) + if( MSVC ) + target_link_options(${TARGET_NAME} PRIVATE /STACK:8388608) + target_link_options(avm_unit_test PRIVATE /STACK:8388608) + else() + target_link_options(${TARGET_NAME} PRIVATE -Wl,--stack,8388608) + target_link_options(avm_unit_test PRIVATE -Wl,--stack,8388608) + endif() endif() # Add tests: for each test JSON file, run avm and compare output with expected From 76374d2f229864bec7a92d391e18900ddbe961b6 Mon Sep 17 00:00:00 2001 From: konard Date: Tue, 3 Feb 2026 02:30:11 +0100 Subject: [PATCH 8/8] Fix CMake: move avm_unit_test link options after target definition The target_link_options for avm_unit_test must come after the add_executable that defines it. Co-Authored-By: Claude Opus 4.5 --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ee7f3d..f395fa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,10 +43,8 @@ if( WIN32 ) # with deeply recursive export_json on large inputs like text2.json) if( MSVC ) target_link_options(${TARGET_NAME} PRIVATE /STACK:8388608) - target_link_options(avm_unit_test PRIVATE /STACK:8388608) else() target_link_options(${TARGET_NAME} PRIVATE -Wl,--stack,8388608) - target_link_options(avm_unit_test PRIVATE -Wl,--stack,8388608) endif() endif() @@ -87,6 +85,11 @@ target_compile_definitions( avm_unit_test PRIVATE AVM_NO_MAIN ) if( WIN32 ) target_link_libraries( avm_unit_test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3p/doublets_ffi.dll.lib" ) + if( MSVC ) + target_link_options(avm_unit_test PRIVATE /STACK:8388608) + else() + target_link_options(avm_unit_test PRIVATE -Wl,--stack,8388608) + endif() endif() add_test( NAME unit_tests COMMAND avm_unit_test )