-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.html
More file actions
258 lines (258 loc) · 6.74 KB
/
Copy pathdebug.html
File metadata and controls
258 lines (258 loc) · 6.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebGPU Shader Debugger</title>
<link rel="stylesheet" href="styles.css">
<style>
:root {
color-scheme: light dark;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
margin: 0;
background: #f8fafc;
color: #0f172a;
}
header {
background: #0f172a;
color: #e2e8f0;
padding: 1.5rem;
}
main {
max-width: 1100px;
margin: 0 auto;
padding: 2rem 1.5rem 3rem;
}
h1 {
margin: 0 0 0.25rem;
font-size: 2rem;
font-weight: 600;
}
p.lead {
margin: 0;
color: #94a3b8;
font-size: 0.95rem;
}
.toolbar {
display: flex;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
margin-bottom: 1.5rem;
}
button {
border: none;
background: #0f766e;
color: white;
padding: 0.55rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
font-size: 0.95rem;
font-weight: 600;
transition: background 0.15s ease-in-out;
}
button:hover {
background: #0d5f59;
}
button:disabled {
background: #94a3b8;
cursor: progress;
}
.status-chip {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-weight: 600;
padding: 0.25rem 0.55rem;
border-radius: 999px;
font-size: 0.8rem;
}
.status-pending { background: #e2e8f0; color: #334155; }
.status-running { background: #fee2e2; color: #b91c1c; }
.status-pass { background: #bbf7d0; color: #166534; }
.status-fail { background: #fecdd3; color: #9f1239; }
table {
width: 100%;
border-collapse: collapse;
background: white;
border-radius: 0.75rem;
overflow: hidden;
box-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.4);
}
thead {
background: #e2e8f0;
text-transform: uppercase;
letter-spacing: 0.08em;
font-size: 0.76rem;
color: #475569;
}
th, td {
padding: 0.85rem 1rem;
vertical-align: top;
border-bottom: 1px solid #e2e8f0;
}
tbody tr:last-child td {
border-bottom: none;
}
td.actions {
width: 120px;
text-align: right;
}
.details {
font-family: "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
font-size: 0.8rem;
white-space: pre-wrap;
color: #475569;
}
.summary {
margin-top: 0.35rem;
font-size: 0.85rem;
color: #64748b;
}
.debug-section {
margin-top: 2.5rem;
}
.debug-section h2 {
font-size: 1.35rem;
margin: 0 0 0.5rem;
font-weight: 600;
color: #0f172a;
}
.debug-controls {
display: flex;
gap: 1rem;
align-items: flex-end;
flex-wrap: wrap;
margin: 1rem 0;
}
.debug-controls label {
display: flex;
flex-direction: column;
gap: 0.3rem;
font-size: 0.9rem;
color: #475569;
}
.debug-controls select {
border: 1px solid #cbd5f5;
border-radius: 0.5rem;
padding: 0.45rem 0.65rem;
font-size: 0.95rem;
background: white;
color: #0f172a;
}
.stage-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 1rem;
}
.stage-card {
background: white;
border: 1px solid #e2e8f0;
border-radius: 0.75rem;
padding: 1rem;
box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.6);
}
.stage-card.pass {
border-color: #bbf7d0;
}
.stage-card.fail {
border-color: #fecdd3;
}
.stage-card h3 {
margin: 0 0 0.4rem;
font-size: 1rem;
color: #0f172a;
}
.stage-card .message {
font-size: 0.85rem;
color: #475569;
margin-bottom: 0.7rem;
}
.stage-card.fail .message {
color: #b91c1c;
}
.stage-card ul {
list-style: none;
padding: 0;
margin: 0;
display: grid;
gap: 0.4rem;
font-family: "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
font-size: 0.75rem;
color: #334155;
word-break: break-word;
}
@media (max-width: 820px) {
th, td { padding: 0.75rem; }
td.actions { width: 90px; }
button { width: 100%; }
.toolbar { flex-direction: column; align-items: stretch; }
}
</style>
</head>
<body>
<header>
<h1>WebGPU Shader Debugger</h1>
<p class="lead">Run synthetic unit tests against individual compute shaders to validate math and buffer bindings.</p>
</header>
<main>
<div class="toolbar">
<button id="run-all">Run All Tests</button>
<span id="device-status" class="summary">GPU device not initialized.</span>
</div>
<table>
<thead>
<tr>
<th>Shader</th>
<th>Description</th>
<th>Status</th>
<th>Details</th>
<th class="actions">Actions</th>
</tr>
</thead>
<tbody id="shader-test-body"></tbody>
</table>
<section class="debug-section">
<h2>Logistic Regression Stage Debugger</h2>
<p id="lr-debug-summary" class="summary">Select a stage and optimizer, then run to inspect intermediate buffers.</p>
<div class="debug-controls">
<label for="lr-step-select">
Stage
<select id="lr-step-select" name="lr-step-select"></select>
</label>
<label for="lr-optimizer-select">
Optimizer
<select id="lr-optimizer-select" name="lr-optimizer-select">
<option value="adam">Adam</option>
<option value="sgd">SGD</option>
</select>
</label>
<button type="button" id="lr-run">Run Stage Debug</button>
</div>
<div id="lr-stage-results" class="stage-grid"></div>
</section>
<section class="debug-section">
<h2>Convolutional Network Stage Debugger</h2>
<p id="cnn-debug-summary" class="summary">Replay forward and backward passes step-by-step to spot failing kernels.</p>
<div class="debug-controls">
<label for="cnn-step-select">
Stage
<select id="cnn-step-select" name="cnn-step-select"></select>
</label>
<label for="cnn-optimizer-select">
Optimizer
<select id="cnn-optimizer-select" name="cnn-optimizer-select">
<option value="adam">Adam</option>
<option value="sgd">SGD</option>
</select>
</label>
<button type="button" id="cnn-run">Run Stage Debug</button>
</div>
<div id="cnn-stage-results" class="stage-grid"></div>
</section>
</main>
<script type="module" src="js/shaderDebug.js"></script>
</body>
</html>