Bruce Lee's Notes

Systems, programming, and engineering practice

Fewer Operations—So Why Disable the Optimization?

Treat disabling an optimization as a design decision about slicing and quantization contracts.

Series contents · Resources and Scheduling · 阅读中文版 “Instead of multiplying the matrices and then taking a small slice, let’s slice the weights first and do a smaller multiplication.” “The equation ......

“I Parsed a Number” Does Not Mean the Input Is Valid

Check full input consumption, signs, and field ranges after parsing succeeds.

Series contents · Resources and Scheduling · 阅读中文版 “How did r7oops get past the register parser?” “The parser successfully read 7.” “What about the oops?” “It didn’t ask.” Many backend bugs arise n......

One More Loop, and the Binary Snapshot Looks Like a Different Program

Examine how loops, labels, and independent emitter instances affect binary determinism.

Series contents · Resources and Scheduling · 阅读中文版 “This test passed a moment ago. It still passes on its own, but the output changes after the rest of the suite.” “Could it be the random seed?” “T......

You Caught the Exception. What Happens to the Half-Written Machine Code?

After catching an error, account for the state and output already produced.

Series contents · Resources and Scheduling · 阅读中文版 “The exception is caught. The compiler won’t crash.” “Then why is only half the output directory there?” “Because another path writes the files.” ......

I Waited for the Event. Why Isn't the Data Ready?

Make synchronization events cover the actual production of data across execution engines.

Series contents · Resources and Scheduling · 阅读中文版 “I added a wait. How can it still read gate values that haven’t finished computing?” “Which event are you waiting for?” “A ready event.” “What act......