sass2mlir / Manual

Contributing

Find the owning layer in the launch layout, build serially, and submit a bounded change with evidence and clear hardware limits.

Project

Contribute a small, checkable change

Start from the active source checkout and its docs/README.md developer guide. Source paths on these pages use the launch layout, with MLIR transform implementations under passes/. The project is AGPL-3.0+; follow its license headers and docs/STYLE.md. The active implementation is moving quickly, so identify the revision and artifacts behind a report instead of assuming these pages describe a tagged release.

Good starting points include a minimized decode/encode mismatch, a refused case with a clear missing contract, a focused host regression, or a correction to a current workflow. For a new optimization, begin with writing a pass.

Code map

Change the layer that owns the behavior

AreaSource locationUseful evidence
Decode, encode and machine IRlib/, inc/, common/Original words, target, expected fields and exact emitted bytes.
SSA, analyses and allocationdialect/lib/SassLift.cpp, SassAnalyses.cpp, SassRegalloc.cppGuard/CFG fixtures, physical spans, allocation and independent writeback checks.
MLIR transformspasses/Admission, positive and refused cases, numerical policy and publication checks.
Runtime integrationpreload/, the runtime adapter subdirectories of passes/, and diagnostics/Plugin ABI, image ownership, launch bindings and failure behavior.
Probing and generated tablestools/, opcodes/Tool identity, bounded probe inputs, retained observations and regeneration checks.

docs/development/code-map.md explains the boundaries. Reuse the existing analysis, layout and publication helpers. A new plugin or a second decoder is rarely the smallest fix.

Checks

Build and test the relevant path

Read AGENTS.md before running tools. On the documented development laptop, builds are strictly serial and local probe/dump tools use at most one worker. Do not start a full probe campaign just to check a patch. Follow installation for configuration, then:

cmake --build build -- -j1
ctest --test-dir build -j1 --output-on-failure \
  -R '^host-(cli|lift-lower|verify|liveness|physical-liveness|uniformity|regalloc)$'

This is a useful host subset, not a universal gate. CTest registers tests according to the configured build and available fixtures; confirm that the relevant tests exist and add a focused regression for changed behavior. Use the repository’s scripts/check-style.py with its documented tools when changing source.

For encoding bugs, retain a minimal cubin or exact instruction words, the SM, toolkit/disassembler version, command, diagnostics and expected result. For transforms, include a case that must refuse as well as one that succeeds.

A useful pull request explains the concrete problem, smallest fix, commands run and their results, plus remaining limits. Keep failed experiments and reverse-engineering explanations in docs/, as the repository requests.