Bruce Lee's Notes

Systems, programming, and engineering practice

Why Write the Same Final State Twice?

Distinguish persistent state, final state, and direct-output buffers.

Series contents · Resources and Scheduling · 阅读中文版 “The final hidden state is already a graph output. Why save it again?” “Because the graph output goes to the caller. Persistent state goes to the ......

The Address Fits. Why Does the Compiler Say Memory Is Full?

Separate encodable addresses, allocation intervals, and actual memory budgets.

Series contents · Resources and Scheduling · 阅读中文版 “I only generated a slightly larger output, and the compiler says global memory is exhausted.” “Does it know how much memory the runtime will prov......

The View Moved No Data. Why Can’t We Return the Memory?

Follow asynchronous consumers through view chains before reclaiming underlying storage.

Series contents · Resources and Scheduling · 阅读中文版 “We’ve passed this tensor’s last user. We can reclaim it.” “That user only changed its shape. The operation that actually reads the data is still ......

A Few More Branches in the Graph—and Synchronization Registers Run Out First?

Explain how graph fan-out and dependency joins create synchronization-resource pressure.

Series contents · Resources and Scheduling · 阅读中文版 “The arithmetic barely grew. Why can’t we even generate the code?” The graph on the whiteboard looks innocent: one producer, followed by many cons......

Why Does Someone Keep Borrowing My “Temporary” Register?

Express register ownership through scope and define the limits of automatic release.

Series contents · Resources and Scheduling · 阅读中文版 “I just need one register to load an address. I’ll give it straight back.” “Funny. The outer loop counter is borrowing that same one.” This argume......