Make null/empty handling explicit and safe—so empty values don’t break logic or even generate invalid syntax, and raw null-pointer checks are replaced with semantic, invariant-based checks.

Guidelines: 1) Avoid “empty variable” syntax bugs (CMake): quote variables in comparisons.

2) Prefer semantic checks over raw pointer null checks (C++ containers/tensors):

3) Don’t over-defend against null in operations that are already null-safe:

4) For null-terminated byte strings, ensure the correct terminator behavior:

Applying these rules reduces crashes, undefined behavior, and correctness issues caused by missing/empty/null values.