Replaces the falsified per-horizon Q_h pool with a single shared
query Q over an extended key sequence [horizon_tokens; LN_b_out],
producing per-horizon outputs via TFT-style horizon-token mixing.
FORWARD:
scores[i] = Σ_d Q[d] · ext[i, d] (i ∈ [0, N_H + K))
attn = softmax_i(scores)
S[d] = Σ_k attn[N_H + k] · ln_out[k, d] (shared time agg)
ctx[h, d] = attn[h] · horizon_tokens[h, d] + S[d] (per-horizon out)
BACKWARD: full chain rule with softmax-centring; gradients to
horizon_tokens, Q, and ln_out via the saved attn weights.
NVIDIA-grade implementation per feedback_nvidia_grade_perf_for_kernels:
- Warp-shuffle reduce (block_reduce_sum / block_reduce_max helpers)
for all per-d dot products and softmax aggregates.
- Cross-warp reduce uses exactly one __syncthreads.
- Non-divergent shuffles: inactive lanes contribute 0 via ternary.
- Block-per-batch + horizon-loop inside block → grad_ln_out += is
race-free without atomicAdd.
- Smem layout computed at launch: [s_attn(N_H+K); s_warp(N_WARPS);
s_d_S(H) on bwd]. No over-allocation.
LOCAL VERIFICATION (RTX 3050 sm_86):
forward_then_backward_matches_central_difference PASSES 12 numgrad
checks (4 each on horizon_tokens / Q / ln_out) at 5e-2 rel / 5e-3
abs envelope. First-try pass.
NOTE: .gitignore adjusted with narrow allow-rules for crates/ml-alpha/{
cuda,src,tests}/horizon_token_* paths — the broad "*token*" rule
intended for auth tokens was hiding these source files. Explicit
allow keeps the security rule intact while exempting these specific
files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
202 lines
3.2 KiB
Plaintext
202 lines
3.2 KiB
Plaintext
# Build artifacts
|
|
/target/
|
|
target/
|
|
|
|
# Feature cache (precomputed .fxcache binaries, ~470MB each)
|
|
test_data/feature-cache/
|
|
/data/feature-cache/
|
|
*.fxcache
|
|
|
|
# IDE files
|
|
.vscode/
|
|
.idea/
|
|
*.swp
|
|
*.swo
|
|
|
|
# OS files
|
|
.DS_Store
|
|
Thumbs.db
|
|
|
|
# Logs
|
|
*.log
|
|
|
|
# Environment variables and secrets
|
|
.env
|
|
.env.*
|
|
!.env.example
|
|
|
|
|
|
# Secret files and directories
|
|
/config/secrets/
|
|
secrets/
|
|
*.key
|
|
*.pem
|
|
*.p12
|
|
*.pfx
|
|
*.crt
|
|
*.cert
|
|
|
|
# Credential files
|
|
credentials.json
|
|
credentials.toml
|
|
auth.json
|
|
auth.toml
|
|
ibkr.txt
|
|
|
|
# Certificate security files
|
|
certs/security.env
|
|
certs/production.env.template
|
|
certs/*.serial
|
|
certs/**/*.serial
|
|
|
|
# API keys and tokens
|
|
*api_key*
|
|
*token*
|
|
*secret*
|
|
!*secret*.example
|
|
!infra/modules/secrets/
|
|
!infra/live/production/secrets/
|
|
!infra/k8s/secrets/
|
|
# Allow ml-alpha horizon-token kernel sources (no secrets, just the v2 attention path)
|
|
!crates/ml-alpha/cuda/horizon_token_*
|
|
!crates/ml-alpha/src/horizon_token_*
|
|
!crates/ml-alpha/tests/horizon_token_*
|
|
!infra/k8s/secrets/*.yaml
|
|
!scripts/deploy-secrets.sh
|
|
|
|
# Database credentials
|
|
database.conf
|
|
db_config.json
|
|
|
|
# Temporary files
|
|
*.tmp
|
|
*.temp
|
|
|
|
# GPU test artifacts
|
|
gpu_test.rs
|
|
simd_bench
|
|
simd_bench.rs
|
|
temp_script.sh
|
|
|
|
# Build artifacts (additional)
|
|
**/*.rs.bk
|
|
*.pdb
|
|
Cargo.lock
|
|
|
|
# Coverage reports
|
|
tarpaulin-report.html
|
|
cobertura.xml
|
|
lcov.info
|
|
|
|
# Benchmark results
|
|
target/criterion/
|
|
target/bench/
|
|
|
|
# CI artifacts
|
|
.training-generated.yml
|
|
audit-results.json
|
|
geiger-report.md
|
|
security-report.md
|
|
outdated.json*.profraw
|
|
|
|
# Python virtual environments and cache
|
|
venv/
|
|
.venv/
|
|
.venv_databento/
|
|
venv_databento/
|
|
__pycache__/
|
|
*.py[cod]
|
|
*.so
|
|
.Python
|
|
*.egg-info/
|
|
.coverage
|
|
coverage.xml
|
|
htmlcov/
|
|
.python-version
|
|
|
|
# ML model checkpoints and training artifacts
|
|
diagnostic_data/
|
|
checkpoints/
|
|
ml/checkpoints/
|
|
ml/trained_models/*.safetensors
|
|
ml/trained_models/norm_stats_*.json
|
|
ml/trained_models/ppo_fold*.safetensors
|
|
ml/trained_models/ppo_fold*.json
|
|
ml/ml/
|
|
|
|
# Removed Windows wrapper files per user request
|
|
hive-mind-prompt-*.txt
|
|
|
|
# Node.js
|
|
node_modules/
|
|
web-dashboard/dist/
|
|
|
|
# Git worktrees
|
|
.worktrees/
|
|
.claude/worktrees/
|
|
|
|
# Serena (IDE agent)
|
|
.serena/
|
|
|
|
# Claude local state
|
|
.claude/settings.local.json
|
|
.claude/ralph-loop.local.md
|
|
.mcp.json
|
|
claude-flow.config.json
|
|
.swarm/
|
|
.hive-mind/
|
|
.claude-flow/
|
|
memory/
|
|
coordination/
|
|
memory/claude-flow-data.json
|
|
memory/sessions/*
|
|
!memory/sessions/README.md
|
|
memory/agents/*
|
|
!memory/agents/README.md
|
|
coordination/memory_bank/*
|
|
coordination/subtasks/*
|
|
coordination/orchestration/*
|
|
*.db
|
|
*.db-journal
|
|
*.db-wal
|
|
*.sqlite
|
|
*.sqlite-journal
|
|
*.sqlite-wal
|
|
claude-flow
|
|
|
|
# Terragrunt cache and generated files
|
|
.terragrunt-cache/
|
|
**/.terragrunt-cache/
|
|
.terraform.lock.hcl
|
|
**/.terraform.lock.hcl
|
|
|
|
# Data cache (downloaded market data, not checked in)
|
|
data/cache/
|
|
|
|
# Generated reports and validation artifacts in test_data
|
|
test_data/**/*REPORT*
|
|
test_data/**/*SUMMARY*
|
|
test_data/**/*METADATA*
|
|
test_data/**/README.md
|
|
test_data/databento/samples/
|
|
|
|
# Large binary files (prevent repo bloat - use LFS or external storage)
|
|
*.dbn
|
|
*.dbn.zst
|
|
*.safetensors
|
|
*.onnx
|
|
*.ot
|
|
*.pt
|
|
*.pth
|
|
*.bin
|
|
# Load test results
|
|
services/*/load_tests/results/
|
|
services/*/load_tests/*.json
|
|
!services/*/load_tests/package.json
|
|
.playwright-mcp/
|
|
crates/ml/ml/
|
|
|
|
# Foxhunt audit hook dedup state (cleared at SessionStart)
|
|
.claude/.foxhunt-audit-state
|
|
/config/ml/alpha_logits_cache.bin
|