Skip to content

Set error=false chunk default to fail builds on uncaught errors - #1512

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:error-default-chunk-option
Mar 21, 2026
Merged

Set error=false chunk default to fail builds on uncaught errors#1512
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:error-default-chunk-option

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

  • Adds Weave.set_chunk_defaults!(:error => false) at the start of weave_file, so benchmark builds now fail if any code chunk throws an uncaught error. Previously, Weave's default (error=true) would silently capture errors and include ugly stacktraces in published output.
  • Adds a contributor guideline section to the README explaining how to properly handle error demonstrations in benchmarks.

Motivation

Benchmarks should fail loudly when code errors unexpectedly, rather than silently producing output with stacktraces. This makes CI more useful for catching real regressions. Chunks that intentionally demonstrate errors (e.g., showing why a method was omitted) need to explicitly opt in via error=true or use try/catch blocks.

This pairs with PR #1511 which already wrapped existing error demonstrations in try/catch.

Changes

src/SciMLBenchmarks.jl: Added Weave.set_chunk_defaults!(:error => false) as the first line of weave_file. This sets the default for all chunks in every benchmark — individual chunks can still override with error=true.

README.md: Added a "Handling Method Omissions and Errors in Benchmarks" section under Contributing with:

  • Guidance that showing why methods fail is valuable
  • Two approaches for capturing errors: try/catch (preferred for friendly messages) and error=true chunk option
  • Examples of both approaches
  • Warning that raw uncaught errors will fail CI

Test plan

🤖 Generated with Claude Code

…rors

Adds Weave.set_chunk_defaults!(:error => false) at the start of
weave_file so that any code chunk throwing an uncaught error will fail
the build. Also adds contributor guidelines to the README explaining
how to properly handle error demonstrations using try/catch or the
error=true chunk option.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisRackauckas
ChrisRackauckas merged commit 6951a4b into SciML:master Mar 21, 2026
2 checks passed
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.

2 participants