Tests: pin the process logger's level filter and file line format #1589

Open
github-bot wants to merge 1 commit from github-bot/gh-1589 into main AGit
Owner

@⁠amazedturnip on GitHub · 2026-11-24 18:00 UTC · original
amazedturnip:xcl/tests-log-contract-level-filter-and-file-format-174713 → main · +89 −0 · 1 files · 1 commits · open

Pins the process logger's contract in a single host-local integration test: Level::parse (case-insensitive; 'warning'->Warn; unknown/empty -> Info), enabled() as an ordering comparison against the level set by init(), and write() emitting one '[][][TAG] \n' line per enabled level and nothing otherwise. init() is also verified to create the log's parent directory and file. Single #[test] in its own binary (no shared Logger state with other tests).

What is in it

  • crates/xcl/tests/log_contract.rs: new integration test pinning log::Level::parse (case-insensitive, 'warning'->Warn, unknown/empty -> Info), enabled() as an ordering comparison against the level set by init, and write() emitting one [<elapsed>][<tid>][<TAG>] <msg>\n line per enabled level and nothing otherwise. Also pins that init() creates the log's parent directory and the log file itself. Single test in its own binary (no other test may observe or set the process-wide logger state).

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=1 — 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows))
  • Verification / negative control: Temporarily patched crates/xcl/src/log.rs to map 'warning' -> Info (breaking the Level::parse contract): cargo test --test log_contract FAILED with 'assertion left == right failed' on line 43 (Level::parse("warning") expected Warn, got Info). Then git checkout -- crates/xcl/src/log.rs restored the source; original run passes.

Not tested

  • No GPU/RTA/testtitle run (test is pure host-local, no device required)
  • Other levels than Warn (e.g. setting Info/Debug/Trace at init and re-checking the filter) - the current single-test file pins only the Warn contract
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1589) `amazedturnip:xcl/tests-log-contract-level-filter-and-file-format-174713` → `main` · +89 −0 · 1 files · 1 commits · open Pins the process logger's contract in a single host-local integration test: Level::parse (case-insensitive; 'warning'->Warn; unknown/empty -> Info), enabled() as an ordering comparison against the level set by init(), and write() emitting one '[<elapsed>][<tid>][TAG] <msg>\n' line per enabled level and nothing otherwise. init() is also verified to create the log's parent directory and file. Single #[test] in its own binary (no shared Logger state with other tests). **What is in it** - `crates/xcl/tests/log_contract.rs`: new integration test pinning `log::Level::parse` (case-insensitive, 'warning'->Warn, unknown/empty -> Info), `enabled()` as an ordering comparison against the level set by `init`, and `write()` emitting one `[<elapsed>][<tid>][<TAG>] <msg>\n` line per enabled level and nothing otherwise. Also pins that `init()` creates the log's parent directory and the log file itself. Single test in its own binary (no other test may observe or set the process-wide logger state). **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=1` — 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows)) - Verification / negative control: Temporarily patched crates/xcl/src/log.rs to map 'warning' -> Info (breaking the Level::parse contract): `cargo test --test log_contract` FAILED with 'assertion `left == right` failed' on line 43 (Level::parse("warning") expected Warn, got Info). Then `git checkout -- crates/xcl/src/log.rs` restored the source; original run passes. **Not tested** - No GPU/RTA/testtitle run (test is pure host-local, no device required) - Other levels than Warn (e.g. setting Info/Debug/Trace at init and re-checking the filter) - the current single-test file pins only the Warn contract - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
crates/xcl/src/log.rs had zero inline tests and zero integration coverage.
This test pins its contract: Level::parse (case-insensitive, 'warning'->Warn,
unknown->Info), enabled() as an ordering comparison against the level set by
init, and write() emitting one '[<elapsed>][<tid>][<TAG>] <msg>\n' line per
enabled level and nothing otherwise. It covers init() creating the log's
parent directory, the Warn filter dropping Info/Debug/Trace lines, and the
exact '[elapsed][tid][TAG] message' line shape.

Note: the logger keeps process-wide state (file handle, level, echo flag),
so this test lives in its own binary (the default for a new integration test
file) with a single #[test]: no other test in this file may observe or set
that state.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:58:29 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 18:53 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head 466a425 (on its base 9e3831e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 776 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: the_log_level_filter_and_file_line_format.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as #1651.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 18:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1589#issuecomment-7141307018) Full-suite run, since this PR has no test report yet. Tested exact head `466a425` (on its base `9e3831e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form`: **776 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `the_log_level_filter_and_file_line_format`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **777 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip`. It fails on main `9e3831e` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (`XCL_HEAP_WINDOWS` unset). Reported as #1651. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:02 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1589#issuecomment-7142969113) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 05:14 UTC · original

Empirical test report (466a4258)

Hardware / environment

  • Windows 11 Enterprise Evaluation x64, build 26200.9974.
  • AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175. The focused test ran on the CPU without D3D12 or GPU calls.
  • rustc --version reported rustc 1.100.0 (0ef1bc386 2026-11-09).
  • & "$env:XCL_DXC_DIR\dxc.exe" --version reported dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47).
  • Tested PR #1589 at detached commit 466a42589febc840198846349b3dccd455114cbb.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test executables, including log_contract. This was a compilation step with zero tests executed.
  • Ran the following in PowerShell outside Invoke-ArcTest.ps1, with no Arc GPU mutex held.
$env:XCL_ADAPTER = 'NONE_CPU_ONLY'; $env:RUST_TEST_NOCAPTURE = '1'; cargo test -p xcl --test log_contract -- --nocapture 2>&1 | Tee-Object -FilePath 'L:\XclTooling\neon-slot-1\tmp\pr1589-focused.log'
  • Cargo exited 0. Case-sensitive counts from the focused log were 1 passed / 0 failed / 0 ignored / 0 skipped, with zero filtered out.

Observed behavior

  • the_log_level_filter_and_file_line_format passed. The test checked case-insensitive level parsing, the warning alias, and the default to Info for unknown and empty values.
  • Logger initialization created the nested parent directory and log file. The Warn threshold produced two lines, one for ERROR and one for WARN . Both lines contained parseable elapsed time and thread ID fields and the expected tag and message. The Info, Debug, and Trace markers were absent.

Not tested

This verification covered workspace test compilation and the focused CPU test. It omitted execution of the full GPU workspace suite and game smoke runs.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1589-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1589#issuecomment-7153585955) ### Empirical test report (466a4258) **Hardware / environment** - Windows 11 Enterprise Evaluation x64, build 26200.9974. - AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175. The focused test ran on the CPU without D3D12 or GPU calls. - `rustc --version` reported `rustc 1.100.0 (0ef1bc386 2026-11-09)`. - `& "$env:XCL_DXC_DIR\dxc.exe" --version` reported `dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47)`. - Tested PR #1589 at detached commit `466a42589febc840198846349b3dccd455114cbb`. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built the workspace test executables, including `log_contract`. This was a compilation step with zero tests executed. - Ran the following in PowerShell outside `Invoke-ArcTest.ps1`, with no Arc GPU mutex held. ```powershell $env:XCL_ADAPTER = 'NONE_CPU_ONLY'; $env:RUST_TEST_NOCAPTURE = '1'; cargo test -p xcl --test log_contract -- --nocapture 2>&1 | Tee-Object -FilePath 'L:\XclTooling\neon-slot-1\tmp\pr1589-focused.log' ``` - Cargo exited 0. Case-sensitive counts from the focused log were **1 passed / 0 failed / 0 ignored / 0 skipped**, with zero filtered out. **Observed behavior** - `the_log_level_filter_and_file_line_format` passed. The test checked case-insensitive level parsing, the `warning` alias, and the default to `Info` for unknown and empty values. - Logger initialization created the nested parent directory and log file. The `Warn` threshold produced two lines, one for `ERROR` and one for `WARN `. Both lines contained parseable elapsed time and thread ID fields and the expected tag and message. The Info, Debug, and Trace markers were absent. **Not tested** This verification covered workspace test compilation and the focused CPU test. It omitted execution of the full GPU workspace suite and game smoke runs. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1589-focused.log` and published.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1589/head:github-bot/gh-1589'
git switch 'github-bot/gh-1589'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1589'
git switch 'github-bot/gh-1589'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1589'
git switch 'github-bot/gh-1589'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1589'
git switch 'main'
git merge --squash 'github-bot/gh-1589'
git switch 'main'
git merge --ff-only 'github-bot/gh-1589'
git switch 'main'
git merge 'github-bot/gh-1589'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.