Warrior_EA/DirectML
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread ea9d86b3ee fix: dense backprop read the weight matrix transposed - on every backend
CaclHiddenGradient computed this layer's gradient as matrix_w[(outputs+1)*i + k]
against a buffer whose actual layout (one row per NEXT-layer neuron, stride
inputs+1) makes the correct read matrix_w[k*(inputs+1) + i]: the transpose for
square layers, and for the non-square boundaries this EA actually builds
(tapered stacks, the 3-neuron head) a mis-strided walk that ran past the buffer
end - garbage on OpenCL, zeroed reads on the CPU DLL, so the tiers did not even
agree with each other. Every gradient crossing a dense boundary on its way down
- the entire learning signal reaching the BN/conv/LSTM front ends - passed
through a fixed wrong matrix: feedback-alignment dynamics, not backprop, which
is why nets still "learned something" and this survived. The book reference
(NeuroNet_DNG) fixed this in a later article version; our kernel descended from
the earlier one. Confounds every model-based negative verdict to date.

Also in this commit, same root cause family:
- per-sample UpdateWeightsAdam (OpenCL): input for slot group j was read at
  matrix_i[j] instead of matrix_i[j*4] (corrupted outer product past group 0),
  and dispatch dim 1 sized on ceil(inputs/4) left the bias column unreachable
  whenever inputs%4==0 - dense biases never trained on OpenCL. Rewritten as a
  lane-guarded scalar loop keeping our Adam conventions (sqrt-stored v,
  decoupled decay, both clamps, no sign gate). The batched accum path never had
  either bug; this kernel is what SetBatchSize(1) runs - including online
  continual learning on client machines, where OpenCL is the only tier.
- conv backward passed raw (int)Activation() where the kernels expect
  NativeActivationCode(): NONE took the tanh branch (clamping a BN layer's
  unbounded z-scores), TANH took sigmoid, PRELU took none. Dormant only because
  the conv sits at layer 1 today.
- hidden-gradient dispatch over Neurons()+1 dropped to Neurons(): biases get no
  backprop gradient and the extra work-item only ever read past matrix_o.

All three backends (Network.cl, WarriorCPU.cpp, WarriorDML.cpp HLSL) changed in
lockstep; DML gained an `inputs` constant to derive the row stride. New
dense_backprop_check.cpp proves the CPU kernel is central-finite-difference
consistent with the real forward kernel on 8x8, 64x3, 33x64, 5x3 (max diff
3e-9) and that all three activation branches match transcription. All 16 checks
pass. Offline math check only - the in-situ proof remains the per-layer dW/W
report on a real era.

FORCES FULL RETRAIN. Both DLLs rebuilt and redeployed to MQL5\Libraries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 18:06:09 -04:00
..
.gitignore fix: the Adam second moment was never Adam - all four tiers 2026-08-09 14:02:35 -04:00
batch_accum_check.cpp fix: the Adam second moment was never Adam - all four tiers 2026-08-09 14:02:35 -04:00
build.bat fix: handle OCL neuron types in gradient clipping and backprop loops 2026-07-28 20:46:27 -04:00
build_accum_check.bat feat: mini-batch gradient accumulation (F4), front-end-aware capacity budget (F6), split Wyckoff categoricals (N1) 2026-08-09 11:48:03 -04:00
build_backprop_check.bat fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
build_cpu.bat perf: the CPU DLL's dot products were never vectorized - /fp:fast 2026-08-11 17:20:12 -04:00
dense_backprop_check.cpp fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
dense_backprop_check.exe fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
dense_backprop_check.obj fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
lstm_seq_flowcheck.cpp fix(ai): positive forget-gate bias, giving the LSTM its window back 2026-07-30 19:15:29 -04:00
lstm_seq_gradcheck.cpp feat(dll): fused sequence-LSTM kernels with real backpropagation-through-time 2026-07-30 18:13:50 -04:00
lstm_seq_gradcheck.exe 2 new files 2026-07-30 18:46:03 -04:00
lstm_seq_gradcheck.obj 2 new files 2026-07-30 18:46:03 -04:00
opencl_seq_syntax_check.cpp feat(ai): sequence-LSTM kernels for the OpenCL tier 2026-07-30 18:40:56 -04:00
smoke_test.cpp fix: remove broken DFA optimizer, use plain gradient descent 2026-07-29 00:03:54 -04:00
WarriorCPU.cpp fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
WarriorCPU.dll fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
WarriorCPU.exp chore: update binary files for WarriorCPU and WarriorDML components 2026-08-09 12:43:49 -04:00
WarriorCPU.h feat: mini-batch gradient accumulation (F4), front-end-aware capacity budget (F6), split Wyckoff categoricals (N1) 2026-08-09 11:48:03 -04:00
WarriorCPU.lib feat: mini-batch gradient accumulation (F4), front-end-aware capacity budget (F6), split Wyckoff categoricals (N1) 2026-08-09 11:48:03 -04:00
WarriorCPU.obj fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
WarriorCPU.pdb fix(Expert/ExpertSignalAIBase): add feature cache and fix oversampling imbalance 2026-07-14 22:49:14 -04:00
WarriorDML.cpp fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
WarriorDML.dll fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
WarriorDML.exp chore: update binary files for WarriorCPU and WarriorDML components 2026-08-09 12:43:49 -04:00
WarriorDML.h feat: mini-batch gradient accumulation (F4), front-end-aware capacity budget (F6), split Wyckoff categoricals (N1) 2026-08-09 11:48:03 -04:00
WarriorDML.lib chore: update binary files for WarriorCPU and WarriorDML components 2026-08-09 12:43:49 -04:00
WarriorDML.obj fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00