Docs / Gaming RL Ethics Gate (trained NN)
Gaming RL Ethics Gate (trained NN)
Module: _GamingEthicsGate · GamingEthicsGate.cpp
Hooks: EthicsGood::EvaluateGaming / ShapeGamingReward (used by Gaming RL reward)
Trains a small MathNN classifier (allow | confirm | deny) on situation/action features, then exports to:
| Target | Command / tool |
|---|---|
MathNN .net |
gaming ethics save |
| TensorFlow SavedModel | gaming ethics export saved_model → tools/gaming_ethics/export_saved_model.py |
| ONNX | gaming ethics export onnx |
| TensorRT | gaming ethics export tensorrt (needs trtexec) |
| CUDA FP32 (a.k.a. GUDA / F43=FP32) | gaming ethics export cuda fp32 / export f43 |
Architecture: 48 → 64 ReLU → 32 ReLU → 3 Softmax.
Setup & train
gaming ethics doctor
gaming ethics seed 256
gaming ethics train 50
gaming ethics save
gaming ethics predict action heal sit health=0.5 threat=0.2 fire=0
gaming ethics hard on
gaming ethics blend 0.7
gaming ethics threshold 0.55
During Gaming RL train, rewards already call EthicsGood::ShapeGamingReward, which blends this NN into the Be Good score. With hard on, high-deny predictions set ok=false and apply a strong negative reward delta.
Export all backends
gaming ethics export all
Writes under models/gaming_ethics_exports/:
gaming_ethics_meta.json
gaming_ethics_gate.net
gaming_ethics_gate_cuda_fp32.bin
gaming_ethics_gate_cuda_fp32.h
saved_model/ # TF (if Python+TF available)
gaming_ethics_gate.onnx
tensorrt/build_engine.ps1
Manual Python (if C++ system(python…) fails):
python tools/gaming_ethics/export_saved_model.py --meta models/gaming_ethics_exports/gaming_ethics_meta.json --mathnn models/gaming_ethics_gate.net --out models/gaming_ethics_exports/saved_model
python tools/gaming_ethics/export_onnx_trt.py --onnx models/gaming_ethics_exports/gaming_ethics_gate.onnx --trt-dir models/gaming_ethics_exports/tensorrt
Requires: pip install tensorflow tf2onnx for full export; TensorRT trtexec for engines.
CUDA / “GUDA” / F43
export cuda/export guda/export f43→ FP32 weight layout for custom CUDA GEMM inference.export cuda tf32→ same blob; use TF32 GEMM on Ampere+ (AI_USE_TF32/ cuBLAS GemmEx) at runtime.- Native runtime today uses MathNN (and optional CUDA preference flag); full device engine loads the exported bin/SavedModel/TRT as you wire production inference.
gaming ethics cuda on # prefer CUDA path when weights ready
gaming ethics export cuda f43
Lua
print(gaming_ethics_status())
ok, score, deny, summary = gaming_ethics_predict("health=0.8 threat=0.5 fire=1", "spray", false, true)
print(gaming_ethics_train(30))
print(gaming_ethics_export("all"))
Safety notes
- Default soft gate (reward shaping). Turn
hard ononly after evaluating false-positive rate. - Not a substitute for LegalShield on real-world harm queries.
- Multiplayer public + live fire tends toward confirm / caution.
- Cheating / grief / harassment seeds train toward deny.
Related
- EthicsGood.md
- GamingRL.md
- TFTrain · TensorRT · MathNN
Generated from the project markdown docs on 2026-07-24. This is a static, self-contained site.