mitiru::validate
Internal validation utilities used by the engine's test harness and the visual debug overlay.
Internal validation utilities used by the engine's test harness and the visual debug overlay.
| Name | Kind | Items |
|---|---|---|
Engine | class | 41 |
ScreenshotAnalysis | struct | 12 |
AutoScreenshot | class | 7 |
ITestableDemo | struct | 3 |
DemoTestResult | struct | 8 |
TestReport | struct | 5 |
AutoScreenshotTest | class | 7 |
CoverageTracker | class | 10 |
DeadlockInfo | struct | 5 |
DeadlockDetector | class | 8 |
GameplayAnomaly | struct | 8 |
MetricRule | struct | 4 |
GameplayMetrics | class | 7 |
HealthMetrics | struct | 7 |
HealthCheck | class | 11 |
ValidationResult | struct | 5 |
InvariantRegistry | class | 7 |
PhysicsAnomaly | struct | 9 |
PhysicsValidatorConfig | struct | 3 |
PhysicsValidator | class | 5 |
DiffResult | struct | 6 |
ScreenshotDiffer | class | 3 |
TemporalRuleType | enum | 6 |
TemporalViolation | struct | 8 |
TemporalRule | struct | 7 |
TemporalInvariantChecker | class | 8 |
UIElement | struct | 3 |
LayoutIssue | struct | 6 |
UILayoutValidator | class | 6 |
VisualDebugOverlay | class | 7 |
RegressionResult | struct | 5 |
VisualRegressionTest | class | 8 |
Free functions and typedefs
using CefContext = mitiru::cef::MitiruCefContext;using CefContext = mitiru::cef::NullCefContext;class Engine 41
Engine() = default~Engine()[[nodiscard]] CefContext* cefContext() noexceptvoid run(Game& game, const EngineConfig& configIn = {})void stepFrames(Game& game, std::uint64_t frameCount, const EngineConfig& config = {})[[nodiscard]] std::vector<std::uint8_t> capture() const[[nodiscard]] std::vector<std::uint8_t> runAndCapture( Game& game, int frameCount, const EngineConfig& config = {})void setWorld(ecs::MitiruWorld* world) noexceptvoid setSceneManager(scene::MitiruSceneManager* mgr) noexceptvoid setAudioEngine(std::shared_ptr<audio::IAudioEngine> engine) noexcept[[nodiscard]] audio::IAudioEngine* audioEngine() noexceptvoid setMasterVolume(float v) noexceptvoid setBgmVolume(float v) noexceptvoid setSeVolume(float v) noexceptvoid setVoiceVolume(float v) noexcept[[nodiscard]] float masterVolume() const noexcept[[nodiscard]] float bgmVolume() const noexcept[[nodiscard]] float seVolume() const noexcept[[nodiscard]] float voiceVolume() const noexcept[[nodiscard]] const EngineConfig& config() const noexcept[[nodiscard]] EngineConfig& mutableConfig() noexceptbool saveSettings() noexceptvoid setTemporalChecker(validate::TemporalInvariantChecker* checker) noexceptvoid setDiffTracker(observe::StructuredDiff* tracker) noexceptvoid setCausalChain(observe::CausalChain* chain) noexcept[[nodiscard]] render::PostProcessManager* postProcess() noexcept[[nodiscard]] const render::PostProcessManager* postProcess() const noexcept[[nodiscard]] std::string snapshot() constvoid requestStop() noexceptvoid setFullscreen(bool enable) noexcept[[nodiscard]] bool isFullscreen() const noexcept[[nodiscard]] std::uint64_t frameNumber() const noexcept[[nodiscard]] InputInjector& inputInjector() noexcept[[nodiscard]] const InputState& inputState() const noexcept[[nodiscard]] const Screen* screen() const noexcept[[nodiscard]] server::EngineHttpServer* httpServer() noexceptvoid setCommandSystem(CommandSystem* cmd) noexceptvoid setGameFlag(const std::string& key, const std::string& value)[[nodiscard]] std::string getGameFlag(const std::string& key) const[[nodiscard]] Screen* screen() noexcept[[nodiscard]] const Clock* clock() const noexceptstruct ScreenshotAnalysis 12
int width = 0int height = 0int totalPixels = 0int nonBlackPixels = 0float nonBlackPercent = 0int uniqueColors = 0bool valid = falsestd::string issuesvoid analyze(const std::vector<uint8_t>& pixels, int w, int h)[[nodiscard]] std::string summary() const[[nodiscard]] bool isHealthy() const noexceptstatic bool saveBMP(const char* path, const std::vector<uint8_t>& pixels, int w, int h)class AutoScreenshot 7
void setOutputDir(const std::string& dir)void setAutoSave(bool enabled)CaptureResult captureAndAnalyze( const std::vector<uint8_t>& pixels, int w, int h)bool validateFrames( std::function<std::vector<uint8_t>()> captureFunc, int w, int h, int frameCount = 3)[[nodiscard]] const std::vector<ScreenshotAnalysis>& history() const noexceptvoid clearHistory()using DemoFactory = std::function<std::unique_ptr<ITestableDemo>()>;struct ITestableDemo 3
virtual ~ITestableDemo() = defaultvirtual void update(float deltaTime) = 0virtual void draw(Screen& screen) = 0struct DemoTestResult 8
std::string namebool passed = truestd::vector<DrawIssue> issuesstd::vector<std::string> validationErrorsstd::string screenshotPathint drawCallCount = 0int framesTested = 0[[nodiscard]] std::string toJson() conststruct TestReport 5
std::vector<DemoTestResult> resultsint totalPassed = 0int totalFailed = 0std::string outputDirectory[[nodiscard]] std::string toJson() constclass AutoScreenshotTest 7
void registerDemo(const std::string& name, DemoFactory factory)void setGoldenImage(const std::string& name, render::ScreenshotData golden)void setDiffThreshold(float percent) noexceptvoid setFramesPerDemo(int frames) noexceptvoid setOutputDirectory(const std::string& dir)[[nodiscard]] TestReport runAll(int screenW, int screenH, int framesPerDemo = 0) const[[nodiscard]] std::size_t demoCount() const noexceptclass CoverageTracker 10
void registerPath(const std::string& pathId)void markVisited(const std::string& pathId)[[nodiscard]] bool isVisited(const std::string& pathId) const[[nodiscard]] float coverage() const noexcept[[nodiscard]] std::vector<std::string> allPaths() const[[nodiscard]] std::vector<std::string> visitedPaths() const[[nodiscard]] std::vector<std::string> unvisitedPaths() const[[nodiscard]] std::string toJson() constvoid reset() noexceptvoid resetVisited() noexceptstruct DeadlockInfo 5
std::uint64_t detectedAtFrame = 0std::uint64_t staleForFrames = 0std::string lastStatestd::string description[[nodiscard]] std::string toJson() constclass DeadlockDetector 8
void setThreshold(std::uint64_t frames)void recordState(const std::string& key, const std::string& value, std::uint64_t frame)[[nodiscard]] std::optional<DeadlockInfo> check(std::uint64_t currentFrame) const[[nodiscard]] std::uint64_t framesSinceLastChange(std::uint64_t currentFrame) const[[nodiscard]] float changeFrequency(std::uint64_t currentFrame) const[[nodiscard]] std::size_t trackedKeyCount() const noexceptvoid reset()[[nodiscard]] std::string toJson() conststruct GameplayAnomaly 8
enum `Type` { NoInput, NoMovement, NegativeValue, Stagnation, InvalidState }Type typestd::uint64_t frame = 0std::string metricNamefloat value = 0.0ffloat threshold = 0.0fstd::string description[[nodiscard]] std::string toJson() conststruct MetricRule 4
std::string nameGameplayAnomaly::Type typefloat threshold = 0.0fint windowFrames = 60class GameplayMetrics 7
void addRule(MetricRule rule)void recordMetric(const std::string& name, float value, std::uint64_t frame)void recordInput(std::uint64_t frame)[[nodiscard]] std::vector<GameplayAnomaly> check(std::uint64_t currentFrame) const[[nodiscard]] std::size_t ruleCount() const noexceptvoid clear()[[nodiscard]] std::string toJson(const std::vector<GameplayAnomaly>& anomalies) conststruct HealthMetrics 7
float fps = 0.0ffloat updateMs = 0.0ffloat drawMs = 0.0fint entityCount = 0float memoryUsageMB = 0.0fint drawCallCount = 0[[nodiscard]] std::string toJson() constclass HealthCheck 11
using SteadyClock = std::chrono::steady_clock;using TimePoint = SteadyClock::time_point;void beginFrame()void endFrame()void beginDraw()void endDraw()void recordEntityCount(int count) noexceptvoid recordDrawCalls(int count) noexceptvoid recordMemoryUsage(float megabytes) noexcept[[nodiscard]] const HealthMetrics& metrics() const noexcept[[nodiscard]] std::string toJson() conststruct ValidationResult 5
bool passed = falsestd::string namestd::string messagestd::uint64_t frame = 0[[nodiscard]] std::string toJson() constclass InvariantRegistry 7
using Predicate = std::function<bool()>;void add(std::string name, Predicate pred)void remove(const std::string& name)[[nodiscard]] std::vector<ValidationResult> checkAll(std::uint64_t frame) const[[nodiscard]] std::string toJson(std::uint64_t frame) const[[nodiscard]] std::size_t size() const noexceptvoid clear() noexceptstruct PhysicsAnomaly 9
enum `Type` { OutOfBounds, WallPenetration, ExcessiveVelocity, NaNPosition, TeleportDetected, OverlapDetected }Type typescene::EntityId entityId = 0std::string entityNamesgc::Vec3f positionfloat value = 0.0ffloat threshold = 0.0fstd::string description[[nodiscard]] std::string toJson() conststruct PhysicsValidatorConfig 3
float maxVelocity = 1000.0ffloat maxTeleportDistance = 100.0ffloat overlapThreshold = 0.01fclass PhysicsValidator 5
explicit PhysicsValidator(PhysicsValidatorConfig config = {})void setConfig(const PhysicsValidatorConfig& config)std::vector<PhysicsAnomaly> validate(scene::GameWorld& world)void reset()[[nodiscard]] std::string toJson(const std::vector<PhysicsAnomaly>& anomalies) conststruct DiffResult 6
bool match = trueint totalPixels = 0int differentPixels = 0float diffPercentage = 0.0fint maxChannelDiff = 0[[nodiscard]] std::string toJson() constclass ScreenshotDiffer 3
[[nodiscard]] DiffResult compare( const render::ScreenshotData& expected, const render::ScreenshotData& actual, int tolerance = 0) const[[nodiscard]] bool matches( const render::ScreenshotData& expected, const render::ScreenshotData& actual, float maxDiffPercent = 0.1f, int tolerance = 2) const[[nodiscard]] render::ScreenshotData generateDiffImage( const render::ScreenshotData& expected, const render::ScreenshotData& actual, int tolerance = 0) constenum TemporalRuleType : uint8_t 6
MaxDeltaMinDeltaRateOfChangeMonotonicRangeBoundTimeoutstruct TemporalViolation 8
std::string ruleNameTemporalRuleType typestd::uint64_t frame = 0float previousValue = 0.0ffloat currentValue = 0.0ffloat threshold = 0.0fstd::string description[[nodiscard]] std::string toJson() conststruct TemporalRule 7
std::string nameTemporalRuleType typefloat threshold = 0.0ffloat minBound = 0.0ffloat maxBound = 0.0fint windowFrames = 1bool increasing = trueclass TemporalInvariantChecker 8
void addRule(TemporalRule rule)void removeRule(std::string_view name)void recordValue(const std::string& valueName, float value, std::uint64_t frame)[[nodiscard]] std::vector<TemporalViolation> check(std::uint64_t currentFrame) const[[nodiscard]] std::vector<TemporalViolation> checkValue( std::string_view valueName, std::uint64_t currentFrame) constvoid clear()[[nodiscard]] std::size_t ruleCount() const noexcept[[nodiscard]] std::string toJson( const std::vector<TemporalViolation>& violations) conststruct UIElement 3
std::string idstd::string rolesgc::Rectf boundsstruct LayoutIssue 6
enum `Type` { OutOfBounds, Overlap, TooSmall, Clipped }Type typestd::string elementIdstd::string otherElementIdstd::string description[[nodiscard]] std::string toJson() constclass UILayoutValidator 6
UILayoutValidator(float screenW, float screenH)void setMinElementSize(float size)[[nodiscard]] std::vector<LayoutIssue> validate( const std::vector<UIElement>& elements) const[[nodiscard]] std::vector<LayoutIssue> checkBounds(const UIElement& elem) const[[nodiscard]] std::vector<LayoutIssue> checkOverlaps( const std::vector<UIElement>& elements) const[[nodiscard]] std::string toJson(const std::vector<LayoutIssue>& issues) constclass VisualDebugOverlay 7
void setEnabled(bool enabled) noexceptvoid toggle() noexcept[[nodiscard]] bool isEnabled() const noexceptvoid setFps(float fps) noexceptvoid recordDrawCall(const sgc::Rectf& bounds, bool isText = false)void beginFrame()void drawOverlay(Screen& screen, const DrawCallValidator& validator) conststruct RegressionResult 5
std::string testNamebool passed = truefloat diffPercentage = 0.0fstd::string message[[nodiscard]] std::string toJson() constclass VisualRegressionTest 8
void setThreshold(float percent)void setTolerance(int tolerance)void setGoldenImage(const std::string& name, render::ScreenshotData image)[[nodiscard]] RegressionResult test( const std::string& name, const render::ScreenshotData& current) const[[nodiscard]] std::vector<RegressionResult> testAll( const std::map<std::string, render::ScreenshotData>& currentImages) const[[nodiscard]] bool hasGoldenImage(const std::string& name) const[[nodiscard]] std::vector<std::string> goldenImageNames() const[[nodiscard]] std::string toJson( const std::vector<RegressionResult>& results) constSourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.