Skip to content

Instantly share code, notes, and snippets.

#
# set up vm
#
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
lume create openclaw --os macos --ipsw latest
lume run openclaw
# login, configure, enable "Remote Login", then exit
nohup lume run openclaw --no-display > /dev/null 2>&1 &

You are a Quality Assurance Software Engineer.

Look at the current diff and refactor.

  • Self-Describing Code: Minimize comments. Use descriptive variable names and constant intermediary variables to explain "why" and "what".
  • Locality over DRY: Prioritize code locality. Keep related logic close together even if it results in slight duplication. Inline small functions. Keep it simple. Do not abstract prematurely.
  • Guard-First Logic: Handle edge cases, invalid inputs, and errors at the start of functions. Return early to keep the "happy path" at the lowest indentation level.
  • Flat Structure: Keep if/else blocks small. Avoid nesting beyond two levels.

QA Focus: All refactors must include assertions or checks for boundary conditions and state mutations.

// RUN: xdsl-opt -t llvm %s | filecheck %s
builtin.module {
"llvm.func"() <{sym_name = "declaration", function_type = !llvm.func<void ()>, CConv = #llvm.cconv<ccc>, linkage = #llvm.linkage<external>, visibility_ = 0 : i64}> ({
}) : () -> ()
// CHECK: declare void @"declaration"()
"llvm.func"() <{sym_name = "named_entry", function_type = !llvm.func<void ()>, CConv = #llvm.cconv<ccc>, linkage = #llvm.linkage<external>, visibility_ = 0 : i64}> ({
^entry:

Use-case: GPU-heavy ML workloads

Reproducibility idea: Terraform definition of system container with NixOS image for reproducibility.

Virtualization

= isolation for workloads sharing the same machine

VMs are only needed for untrusted users (of cloud providers) or workloads that need their own kernels. They add unnecessary overhead, except for micro VMs like "kata containers" (misnomer).

{
"unmatched_xdsl": [
"llvm.call_intrinsic",
"llvm.mlir.addressof",
"llvm.mlir.constant",
"llvm.mlir.global",
"llvm.mlir.null",
"llvm.mlir.undef",
"llvm.mlir.zero"
],
@sueszli
sueszli / intended-mapping.json
Last active January 5, 2026 22:44
intended op mapping
{
"llvm.add": "add",
"llvm.fadd": "fadd",
"llvm.sub": "sub",
"llvm.fsub": "fsub",
"llvm.mul": "mul",
"llvm.fmul": "fmul",
"llvm.udiv": "udiv",
"llvm.sdiv": "sdiv",
"llvm.fdiv": "fdiv",
@sueszli
sueszli / compare.sh
Created January 4, 2026 16:00
type conversions are correct. differences are purely cosmetic or related to generator defaults.
#!/bin/bash
set -e
set -o pipefail
# llvmlite
uv run python tests/backend/llvm/generate_types_ir.py --mlir > source.mlir
uv run python tests/backend/llvm/generate_types_ir.py --llvm > generated.ll
# mlir-translate
cat source.mlir | \
I think it might make sense to `@cache`.
retrieval benchmark results:
- mixed types: 1.57x speedup
- repeated types: 2.31x speedup
- unique types: 0.68x speedup
- avg speed: 1.52x
{
"xdsl.dialects.builtin": {
"IntegerType": "ir.IntType",
"IndexType": "ir.IntType(64)",
"Float16Type": "ir.HalfType",
"Float32Type": "ir.FloatType",
"Float64Type": "ir.DoubleType",
"BFloat16Type": null,
"Float80Type": null,
@sueszli
sueszli / reprod.py
Last active January 1, 2026 22:44
Drop `scf.if` if it only has an `scf.yield`.
from xdsl.dialects import scf, arith, func
from xdsl.ir import Block, Region
from xdsl.context import Context
from xdsl.pattern_rewriter import PatternRewriteWalker, PatternRewriter, GreedyRewritePatternApplier
from xdsl.transforms.canonicalization_patterns.scf import IfPropagateConstantCondition
from xdsl.printer import Printer
ctx = Context()
ctx.load_dialect(scf.Scf)
ctx.load_dialect(arith.Arith)