[ID] env:TG_DETERMINISTIC
[分类] debug
[中文名] 确定性模式（逐位可复现）
[英文名] Deterministic mode (bitwise reproducible)
[作者] TGAI

=== 中文 ===
`TG_DETERMINISTIC=1` 时，反向里所有「散射累加」改走**无 atomicAdd** 的确定性内核
（目标行 / 下标独占、源顺序升序累加）—— 同样的输入与步数，多次运行**逐位可复现**。

取值只接受 `1/0`（也认 `true/false`、`on/off`、`yes/no`）。写错会在解析时**直接报错**，
不会静默降级 —— 静默降级会让「我明明开了确定性」变成一个查不出来的假象（这是刻意的设计）。

默认关闭（走原子加，更快）。⚠️ 它保证的是**归约顺序**确定，不保证跨设备 / 跨驱动版本的逐位一致。

=== English ===
With `TG_DETERMINISTIC=1`, every "scatter-add" in backward uses **no-atomicAdd**
deterministic kernels (each destination row/index is owned by one thread and sources are
accumulated in ascending order) -- the same inputs and steps become **bitwise reproducible**
across runs.

Only `1/0` is accepted (also `true/false`, `on/off`, `yes/no`). A wrong value **raises
during parsing** instead of silently degrading -- silent degradation would turn "I did
enable determinism" into an invisible bug (this is deliberate).

Off by default (atomic adds, faster). ⚠️ It guarantees a deterministic **reduction order**,
not bitwise equality across devices or driver versions.

=== 示例 ===
TG_DETERMINISTIC=1 python -m tgai_go.train.v3_pretrain ...
TG_DETERMINISTIC=0 python -m tgai_go.train.v3_pretrain ...

=== 见也 ===
env:TG_SUMSQ_EXACT
op:sum
