Repository navigation
CI Controlled Failure Rehearsal
Audience: Programmers, QA
Thread Context: N/A (development/CI process reference)
Platform/Backend Scope: GitHub Actions
Build SparkEngineworkflow (ubuntu-24.04 / windows runners)
CI-100[0] requires evidence that a controlled test, sanitizer, format,
threshold, registration, and validation failure each make the Required CI Gate
turn red — proof that the gate is fail-closed, not merely green by habit. This
page describes the rehearsal that produces that evidence on demand, from one
maintainer command, without changing production CI behaviour.
The rehearsal applies a tiny, defect-introducing patch on a throwaway branch,
watches the real Build SparkEngine run go red, records the run, and tears the
branch down. The patches are never merged; applying one introduces a defect the
gate is designed to catch, so nothing here weakens a gate.
- Producing the hosted CI-100[0] evidence (an owner task; see below).
- Confirming, after a workflow change, that each required check still reddens the gate.
- Reviewing which intended job and step each class reaches.
| Class | Patch (tools/ci/controlled-failures/) |
Required job that turns red | Real check |
|---|---|---|---|
| test | test.patch |
build-linux-gcc |
ctest → SparkTests returns EXIT_FAILURE
|
| sanitizer | sanitizer.patch |
build-linux-asan |
AddressSanitizer heap-use-after-free, halt_on_error=1
|
| format | format.patch |
check-format |
clang-format 18 --dry-run --Werror
|
| threshold | threshold.patch |
coverage |
scripts/coverage-report.sh per-subsystem threshold |
| registration | registration.patch |
validate-ci-tools |
tools/check-test-registration.sh |
| validation | validation.patch |
docs-health |
tools/site-data/validate.py (readiness path check) |
Every one of these jobs is listed in required-ci-gate.needs and in the gate's
EXPECTED_REQUIRED_JOBS_JSON (.github/workflows/build.yml), so a non-success
result in any of them makes verify-required-jobs.py report the gate as
failure. The driver verifies the intended step's failure; the map is pinned by
.github/scripts/test-workflow-failure-propagation.py
(test_ci100_controlled_failure_classes_map_to_gated_required_jobs), which runs
in the required validate-ci-tools job.
Each patch was verified to fail its real check with the patch applied and pass without it:
-
format — pinned clang-format 18.1.3 (
--dry-run --Werror) flags the patched file (exit 1); clean after revert. -
registration —
tools/check-test-registration.shreportsMISSING REGISTRATION: Tests/TestCI100RegistrationProbe.cpp(exit 1); clean after revert. -
validation —
python3 tools/site-data/validate.pyfails withreferenced path does not exist(exit 1), as does thedocs-healthTests/Tools/test_site_data_contract.pysuite; clean after revert. -
threshold —
scripts/coverage-report.shon a synthetic lcov fixture with theCorethreshold raised to 100 % reportsCore … FAIL >= 100%(exit 1); the baseline 40 % threshold passes. A real instrumented coverage build is the hostedcoveragejob. A 100 % threshold can be met in principle; the fixture only proves the check rejects its below-threshold measurement. -
test / sanitizer — the probe bodies were compiled against the real
Tests/TestFramework.hwith a minimal runner.EXPECT_TRUE(false)produces a hard failure and a non-zero process exit; the AddressSanitizer build of the heap-use-after-free probe reportsheap-use-after-freeand aborts. The end-to-end full-suite red (the wholeSparkTestscorpus underctest/ the ASan lane) is produced by the hosted rehearsal, not re-built locally.
# Dry run (default) — prints the plan, touches nothing, needs no gh auth:
python3 tools/ci/run_controlled_failure_rehearsal.py --base <base-sha>
# Execute — pushes rehearsal branches, opens draft do-not-merge PRs, records
# evidence, then closes the PRs and deletes the branches:
python3 tools/ci/run_controlled_failure_rehearsal.py --base <base-sha> --executeFor each class the driver creates rehearsal/ci100-<class>-<shortsha>-<run-id> from the
base SHA, applies the patch, opens a draft PR against Working labelled
do-not-merge, waits for the Build SparkEngine run, records the run id, the
failing job(s), intended failing step, patch SHA, PR URL, and the Required CI Gate conclusion into
docs/readiness/evidence/ci100-controlled-failures.json, then closes the PR and
deletes the branch after checking its SHA. A class is marked demonstrated only
when a pull_request Build run belongs to that PR and exact pushed patch SHA,
the intended job and step fail, and the gate and run conclude failure.
Cleanup failures are recorded and make the command fail. Unit tests for the driver (fake gh, no network) live
in tools/ci/test_run_controlled_failure_rehearsal.py.
build.yml already has a default-off workflow_dispatch input,
simulate_required_job_failure. When explicitly enabled, its probe fails the
Controlled required-job failure probe step in validate-ci-tools. A dispatch
from Working can establish generic propagation from one required job to the
gate at that ref. It does not exercise the six defect classes above.
The draft-PR rehearsal exercises six class-specific checks with patches based
on a selected SHA. Its runs are pull_request events targeting Working, not
pushes or dispatches on Working. Even six demonstrated PR records do not by
themselves settle the work item's Working-branch definition of done.
CI-100[0]'s definition of done asks for a controlled required-job failure that
turns the gate red "on Working." The rehearsal runs on draft do-not-merge
pull requests whose base is Working, because the Build SparkEngine workflow
treats pull_request events into Working with the same required job set and
the same always-running gate as a Working push (no paths/paths-ignore
filters; the gate is if: always() and needs the full inventory). Whether a
draft-PR red run satisfies the "on Working" wording, or whether a direct push to
Working (temporarily, behind the ruleset) is required, is an owner
decision. Until that decision and the required hosted evidence exist,
CI-100[0] remains unmet. A dispatch probe can complement the PR records, but
neither local fake-runner tests nor a generic dispatch substitutes for six
class-specific hosted failures.
-
A class is not marked
demonstrated. Inspect the recordedrunIdandpatchSha: the PR identity, exact SHA, intended job, failing step, Build conclusion, and gate conclusion must all match. -
git applyfails for a patch. The base SHA drifted from where the patch was captured. Re-capture the patch against the current base (edit the file,git diffit, revert), keeping the change minimal and single-class. -
The rehearsal reports cleanup errors. Inspect the named PR and branch.
Close only the PR created by this run; delete a branch only after confirming
it still points to the recorded
patchSha. A hard interrupt can skip cleanup.
Published from 614bca17b41e. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Platform Certification
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- CI Controlled-Failure Rehearsal
- Release Publication Stages
- Session Handoff 2026-09-27
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Online Service Boundary
- Server Operations Runbook
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers