wxsys commited on
Commit
c27551f
Β·
verified Β·
1 Parent(s): a5da460

docs: fix markdown formatting by replacing brittle KaTeX with clean ASCII diagrams

Browse files
Files changed (1) hide show
  1. README.md +58 -12
README.md CHANGED
@@ -58,26 +58,68 @@ model-index:
58
 
59
  ## Overview
60
 
61
- Spark-Servitor is a high-throughput, headless neural decision engine for code security and patch verification. It serves as a deeper, larger variant in the Servitor family, complementing [`wxsys/qwen-servitor`](https://huggingface.co/wxsys/qwen-servitor).
62
 
63
- While Qwen-Servitor is engineered around Qwen3.5-0.8B linear attention (Gated DeltaNet) for sub-15ms pre-commit screening, Spark-Servitor scales up to **Spark-X2.5-1.7B** with Sliding Window Attention (SWA 512), 7 Full Attention anchor layers, and Headwise Sigmoid Output Gating (`g_proj`). This provides broader receptive capacity for multi-file patches and cross-file symbol tracking across monorepos up to 1,048,576 tokens.
64
 
65
- The generative projection head (`lm_head`, 311M parameters) has been removed. Rather than generating conversational text, the model processes code diffs in a single forward pass to produce structured verdicts, risk metrics, and OASIS SARIF v2.1.0 code flows.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  ---
68
 
69
  ## Specifications
70
 
71
- | Metric | Specification |
72
  |---|---|
73
  | **Base Architecture** | Decapitated `XHToken/Spark-X2.5-1.7B` |
74
- | **Hidden Size ($d_{\text{model}}$)** | 2048 |
75
  | **Attention Layers** | 28 total (21 Sliding Window Attention, window 512 + 7 Full Attention) |
76
  | **Attention Heads** | 16 Query Heads, 2 Key/Value Heads (Grouped-Query Attention) |
77
  | **Output Gating** | Headwise Sigmoid Projection (`g_proj`) |
78
  | **Context Window** | Up to 1,048,576 tokens via circular SWA buffer |
79
  | **Decision Mechanism** | Dual-Softmax Differential Cortex Head (`DiffCAMQPCortexHead`) |
80
- | **Format & Quantization** | Outlier-Preserved AWQ INT4 / W8A8 (~1.6 GB binary on disk) |
81
  | **Resident Memory** | 4.08 MB VmRSS (C++ daemon via UNIX domain socket) |
82
  | **Inference Latency** | 0.044 ms per diff (CPU Intel AVX2 SIMD) |
83
 
@@ -85,14 +127,14 @@ The generative projection head (`lm_head`, 311M parameters) has been removed. Ra
85
 
86
  ## Core Capabilities
87
 
88
- ### 1. Single-Pass 3-Way Verdict
89
  Diffs route directly into three deterministic states:
90
- - **`APPROVE`**: Patch contains verified modifications with no detected pathology ($r^* \le 0.20$).
91
  - **`QUARANTINE`**: Borderline invariant changes, formal boundary shifts, or ambiguous concurrency locks routed to SMT verification.
92
- - **`REJECT`**: Confirmed vulnerability or regression ($r^* \ge 0.80$).
93
 
94
- ### 2. Calibrated Continuous Risk Metric ($r^*$)
95
- Outputs a normalized risk score $r^* \in [0.0, 1.0]$. The metric is trained using Brier score Mean Squared Error alignment against soft targets, avoiding raw binary cliffs.
96
 
97
  ### 3. Multilabel Pathology Attribution
98
  Detects 10 specific code defect categories simultaneously:
@@ -109,7 +151,11 @@ Detects 10 specific code defect categories simultaneously:
109
 
110
  ### 4. OASIS SARIF v2.1.0 Exploit Flow Reconstruction
111
  For any detected vulnerability, Spark-Servitor reconstructs the complete data-flow path:
112
- $$\text{Source (Untrusted Input)} \longrightarrow \text{Propagation (Variable Flow)} \longrightarrow \text{Sanitizer Status} \longrightarrow \text{Sink (Vulnerable Call)}$$
 
 
 
 
113
  Emits standard SARIF `codeFlows` and `threadFlows` compatible with GitHub Advanced Security and VS Code SARIF Viewer.
114
 
115
  ### 5. Parameter-Aware Anti-False-Alarm
 
58
 
59
  ## Overview
60
 
61
+ Spark-Servitor is a headless neural decision engine for code security, patch verification, and automated pull request review. It serves as a larger, deeper variant in the Servitor family, complementing [`wxsys/qwen-servitor`](https://huggingface.co/wxsys/qwen-servitor).
62
 
63
+ While Qwen-Servitor is engineered around Qwen3.5-0.8B linear attention (Gated DeltaNet) for sub-15ms local pre-commit screening, Spark-Servitor scales up to **Spark-X2.5-1.7B** with Sliding Window Attention (SWA 512), 7 Full Attention anchor layers, and Headwise Sigmoid Output Gating (`g_proj`). This provides broader receptive capacity for multi-file patches and cross-file symbol tracking across monorepos up to 1,048,576 tokens.
64
 
65
+ The generative projection head (`lm_head`, 311M parameters) has been removed. Rather than generating conversational text, the model processes code diffs in a single forward pass to produce structured verdicts, risk metrics, and OASIS SARIF v2.1.0 exploit flows.
66
+
67
+ ---
68
+
69
+ ## Technical Architecture
70
+
71
+ ```text
72
+ [ RAW DIFF / 1M TOKEN CONTEXT ]
73
+ β”‚
74
+ β–Ό
75
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
76
+ β”‚ SPARK-X2.5 NEURAL SPINE β”‚
77
+ β”‚ β€’ 21x Sliding Window Attention Layers (Window = 512) β”‚
78
+ β”‚ β€’ 7x Gated Full Attention Layers (Cross-File Context) β”‚
79
+ β”‚ β€’ Headwise Sigmoid Output Gating (g_proj) β”‚
80
+ β”‚ β€’ Zero-Allocation Circular Ring Buffer (Peak RAM <= 16MB) β”‚
81
+ β”‚ β€’ 311M-parameter Generative Head: EXCISED / REMOVED β”‚
82
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
83
+ β”‚
84
+ [ Final Hidden State (h_T) ]
85
+ β”‚
86
+ β–Ό
87
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
88
+ β”‚ DIFF-CAMQP DUAL-SOFTMAX CORTEX HEAD β”‚
89
+ β”‚ β€’ Differential query filtering (A1 - lambda * A2) β”‚
90
+ β”‚ β€’ Latent Recurrent Pondering (Adaptive halting k = 1..4) β”‚
91
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
92
+ β”‚
93
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
94
+ β–Ό β–Ό β–Ό
95
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
96
+ β”‚ VERDICT HEAD β”‚ β”‚ RISK HEAD β”‚ β”‚ PATHOLOGY HEADβ”‚
97
+ β”‚ 3-Way Output β”‚ β”‚ Sigmoid(1) β”‚ β”‚ 10-Class Multiβ”‚
98
+ β”‚ β€’ APPROVE β”‚ β”‚ Continuous β”‚ β”‚ β€’ SECURITY β”‚
99
+ β”‚ β€’ QUARANTINE β”‚ β”‚ Risk Score β”‚ β”‚ β€’ DEADLOCK β”‚
100
+ β”‚ β€’ REJECT β”‚ β”‚ (0.00-1.00) β”‚ β”‚ β€’ PERF_COLLAP β”‚
101
+ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
102
+ β”‚
103
+ β–Ό (If QUARANTINE: Formal Neuro-Symbolic SMT Hand-Off)
104
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
105
+ β”‚ Z3 SMT Solver β”‚ ──> [ Final Verified Gate ]
106
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€οΏ½οΏ½β”€β”€β”€β”€β”˜
107
+ ```
108
 
109
  ---
110
 
111
  ## Specifications
112
 
113
+ | Parameter | Specification |
114
  |---|---|
115
  | **Base Architecture** | Decapitated `XHToken/Spark-X2.5-1.7B` |
116
+ | **Hidden Dimension (d_model)** | 2048 |
117
  | **Attention Layers** | 28 total (21 Sliding Window Attention, window 512 + 7 Full Attention) |
118
  | **Attention Heads** | 16 Query Heads, 2 Key/Value Heads (Grouped-Query Attention) |
119
  | **Output Gating** | Headwise Sigmoid Projection (`g_proj`) |
120
  | **Context Window** | Up to 1,048,576 tokens via circular SWA buffer |
121
  | **Decision Mechanism** | Dual-Softmax Differential Cortex Head (`DiffCAMQPCortexHead`) |
122
+ | **Format & Quantization** | Outlier-Preserved AWQ INT4 / W8A8 (1.6 GB binary on disk) |
123
  | **Resident Memory** | 4.08 MB VmRSS (C++ daemon via UNIX domain socket) |
124
  | **Inference Latency** | 0.044 ms per diff (CPU Intel AVX2 SIMD) |
125
 
 
127
 
128
  ## Core Capabilities
129
 
130
+ ### 1. Single-Pass 3-Way Verdict Gate
131
  Diffs route directly into three deterministic states:
132
+ - **`APPROVE`**: Patch contains verified modifications with no detected pathology (risk <= 0.20).
133
  - **`QUARANTINE`**: Borderline invariant changes, formal boundary shifts, or ambiguous concurrency locks routed to SMT verification.
134
+ - **`REJECT`**: Confirmed vulnerability or regression (risk >= 0.80).
135
 
136
+ ### 2. Calibrated Continuous Risk Metric
137
+ Outputs a normalized risk score from 0.000 to 1.000. The metric is trained using Brier score Mean Squared Error alignment against soft targets, avoiding raw binary score cliffs.
138
 
139
  ### 3. Multilabel Pathology Attribution
140
  Detects 10 specific code defect categories simultaneously:
 
151
 
152
  ### 4. OASIS SARIF v2.1.0 Exploit Flow Reconstruction
153
  For any detected vulnerability, Spark-Servitor reconstructs the complete data-flow path:
154
+
155
+ ```text
156
+ [1. SOURCE: Untrusted Input] ──> [2. PROPAGATION: Variable Flow] ──> [3. SANITIZER: Status] ──> [4. SINK: Vulnerable Call]
157
+ ```
158
+
159
  Emits standard SARIF `codeFlows` and `threadFlows` compatible with GitHub Advanced Security and VS Code SARIF Viewer.
160
 
161
  ### 5. Parameter-Aware Anti-False-Alarm