mflux-testing

Runs pytest suites in mflux and manages golden image test outputs safely.

2.4k|187|Updated Aug 10, 2024
One-click install
npx skills add https://github.com/mflux-community/mflux --skill mflux-testing-mflux-community
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mflux-testing
Source: https://github.com/mflux-community/mflux/tree/main/.cursor/skills/mflux-testing
Command: npx skills add https://github.com/mflux-community/mflux --skill mflux-testing-mflux-community

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running image-generating tests in the mflux repository risks losing output artifacts and accidentally overwriting golden reference images, making test failures hard to diagnose and regressions hard to control. ## Core Features & Use Cases - Test Execution Recipes: Run fast, slow, default, or full pytest suites via justfile commands like just test-fast and just test-slow with output preservation enabled. - Golden Image Management: Compare generated PNGs against tests/resources/reference_*.png and update references only with explicit approval after hardware validation. - Failure Reporting: Summarize failing test names, key assertions, and point to generated artifacts on disk for manual review. - Use Case: After porting a new model to MLX, run slow tests with preserved outputs, inspect output versus reference images, and commit updated golden images together with the tests. ## Quick Start Run the fast test suite for mflux and preserve all test outputs so I can inspect any failures.

Frequently Asked Questions about mflux-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run tests in the mflux repository?▼

Run tests using the justfile recipes: `just test-fast` for fast tests without image generation, `just test-slow` for image-generating tests, `just test` for the default selection, or `just test-all` for everything except high-memory tests.

How do I update golden reference images in pytest?▼

Update golden images only with explicit approval after validating on target hardware. Run the slow test, compare `output_*.png` against `reference_*.png` in tests/resources, then regenerate with identical test parameters and commit tests and references together.

Why do golden image tests fail after a hardware change?▼

Golden tests lock mflux-native sampling using mx.random and mflux schedulers, so results differ across hardware. References typically allow a 15% mismatch threshold, but a hardware refresh may require regenerating reference PNGs on the CI Mac.

How do I preserve test output images when running pytest?▼

Set the MFLUX_PRESERVE_TEST_OUTPUT=1 environment variable on test runs so generated images are kept on disk for inspection. This flag is already built into the justfile test recipes in the mflux repository.

When should I not regenerate golden reference images?▼

Never regenerate reference images unless the user explicitly requests it. Golden images reflect the validated mflux recipe on CI hardware, so replacing them without validation can mask real regressions in model code.