Skip to content

Features for CUDA.jl conversion#129

Draft
maleadt wants to merge 6 commits intomainfrom
tb/cuda
Draft

Features for CUDA.jl conversion#129
maleadt wants to merge 6 commits intomainfrom
tb/cuda

Conversation

@maleadt
Copy link
Copy Markdown
Collaborator

@maleadt maleadt commented Apr 18, 2026

  • Custom test record (basically Support custom records #51) for GPU RSS reporting
  • exename, exeflags, and env kwargs for running under compute-sanitizer

maleadt and others added 3 commits April 17, 2026 15:23
Splits `runtest` into the PTR-owned boilerplate (temp module creation,
imports, TESTSET_PRINT_ENABLE handling) and a dispatchable `execute` function
that performs the actual test invocation and returns the record. Users can
subtype `AbstractTestRecord` and dispatch `execute(::Type{MyRecord}, ...)` to
collect custom per-test metrics — without re-implementing the scaffolding.

`runtests` gains two kwargs: `RecordType = TestRecord` selecting the concrete
record type, and `custom_args = (;)` threaded through to `execute` for
per-run configuration.

Print methods (`print_header`, `print_test_started`, `print_test_finished`,
`print_test_failed`, `print_test_crashed`, `test_IOContext`) now dispatch on
`AbstractTestRecord` so custom record types can override output. The
`record.rss` access in `print_test_finished` now goes through the generic
`memory_usage`.

`addworker` eagerly imports ParallelTestRunner on the worker before running
`init_worker_code`, since user-supplied initialization commonly references
`AbstractTestRecord`, `WorkerTestSet`, etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds `exename`, `exeflags`, and `env` kwargs to `runtests`, threaded into the
internal `addworker` call so every default-pool worker (and any respawns
inside `runtests`) inherits them. `exename` accepts both `String` and `Cmd`,
enabling callers to wrap the julia invocation with a tool such as
`compute-sanitizer`. Custom workers created from a `test_worker` hook are
still the caller's responsibility.

Also fixes `addworker` to copy its `env` argument before appending
`JULIA_NUM_THREADS` / `OPENBLAS_NUM_THREADS`, so a caller-supplied vector
is not mutated across calls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds custom record types (`RecordType` + `custom_args` + dispatchable
`execute`, print methods generalized to `AbstractTestRecord`) and global
worker configuration on `runtests` (`exename`/`exeflags`/`env` threaded
into every internal `addworker` call). Both features are additive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vchuravy vchuravy mentioned this pull request Apr 18, 2026
maleadt and others added 3 commits April 18, 2026 10:16
Instead of requiring `AbstractTestRecord` subtypes to redeclare every
baseline field, treat `TestRecord` as the canonical baseline and have
wrappers carry a `base::TestRecord` field. `Base.parent` is the accessor;
default `print_*` and `memory_usage` route through it so wrapped records
inherit the standard output unchanged. `execute` implementations delegate
to `execute(TestRecord, …)` and wrap the result.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`result.value` in the end-of-run output dump bypassed the accessor
introduced in the composition refactor, crashing on non-`TestRecord`
subtypes. Route through `result[]` to match the convention already used
elsewhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant