-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment_tracker.ps1
More file actions
288 lines (252 loc) · 8.83 KB
/
deployment_tracker.ps1
File metadata and controls
288 lines (252 loc) · 8.83 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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# Deployment Tracker - Phase 1, 2, 3 Enhancement Status
# Tracks implementation progress for performance optimizations
param(
[switch]$Check,
[switch]$Status,
[switch]$Phase1,
[switch]$Phase2,
[switch]$Phase3,
[switch]$All
)
$ErrorActionPreference = "Continue"
# Color output functions
function Write-ColorOutput($ForegroundColor) {
$fc = $host.UI.RawUI.ForegroundColor
$host.UI.RawUI.ForegroundColor = $ForegroundColor
if ($args) {
Write-Output $args
}
$host.UI.RawUI.ForegroundColor = $fc
}
function Write-Success { Write-ColorOutput Green $args }
function Write-Warning { Write-ColorOutput Yellow $args }
function Write-Error { Write-ColorOutput Red $args }
function Write-Info { Write-ColorOutput Cyan $args }
# Phase 1 - Near Term
$Phase1Items = @(
@{
Name = "MemoryPool for entity IDs"
Description = "High-churn allocation optimization for entity ID management"
File = "src/ecs/entity.zig"
Pattern = "MemoryPool|ObjectPool|entity.*pool|pool.*entity"
Status = $false
},
@{
Name = "ArrayHashMap for archetype queries"
Description = "Stable iteration for archetype lookups"
File = "src/ecs/world.zig"
Pattern = "ArrayHashMap|std\.hash_map\.ArrayHashMap"
Status = $false
},
@{
Name = "Profiling integration"
Description = "Measure actual performance gains"
File = "src/performance.zig"
Pattern = "profiling|Profiler|measureGains|performance.*measure|benchmark"
Status = $false
}
)
# Phase 2 - Medium Term
$Phase2Items = @(
@{
Name = "Parallel ECS query execution"
Description = "Job system for parallel query processing"
File = "src/ecs"
Pattern = "parallel|job.*system|thread.*pool"
Status = $false
},
@{
Name = "GPU-driven rendering"
Description = "Compute shaders for rendering pipeline"
File = "src/rendering"
Pattern = "compute.*shader|gpu.*driven"
Status = $false
},
@{
Name = "Texture streaming for large worlds"
Description = "Stream textures based on distance/visibility"
File = "src/rendering"
Pattern = "texture.*stream|streaming"
Status = $false
}
)
# Phase 3 - Long Term
$Phase3Items = @(
@{
Name = "Custom allocators for specific subsystems"
Description = "Specialized allocators per subsystem"
File = "src/common/memory.zig"
Pattern = "custom.*allocator|subsystem.*allocator"
Status = $false
},
@{
Name = "Hot-reloading of compiled shaders"
Description = "Reload shaders without restart"
File = "src/rendering"
Pattern = "hot.*reload|shader.*reload"
Status = $false
},
@{
Name = "Memory tracking and profiling tools"
Description = "Tools for memory usage analysis"
File = "src/performance.zig"
Pattern = "memory.*track|profiling.*tool"
Status = $false
}
)
function Check-Implementation {
param($Item)
$filePath = $Item.File
if (-not (Test-Path $filePath)) {
# Try to find in directory
if (Test-Path $filePath -PathType Container) {
$files = Get-ChildItem -Path $filePath -Recurse -Filter "*.zig" -ErrorAction SilentlyContinue
$found = $false
foreach ($file in $files) {
$content = Get-Content $file.FullName -Raw -ErrorAction SilentlyContinue
if ($content -match $Item.Pattern) {
$found = $true
break
}
}
return $found
}
return $false
}
$content = Get-Content $filePath -Raw -ErrorAction SilentlyContinue
if ($content -and $content -match $Item.Pattern) {
return $true
}
return $false
}
function Show-PhaseStatus {
param($PhaseName, $Items, $PhaseNumber)
Write-Info "`n=== $PhaseName ==="
Write-Info "Phase $PhaseNumber - $(if ($PhaseNumber -eq 1) { 'Near Term' } elseif ($PhaseNumber -eq 2) { 'Medium Term' } else { 'Long Term' })"
Write-Info ""
$completed = 0
foreach ($item in $Items) {
$status = Check-Implementation $item
$item.Status = $status
$statusIcon = if ($status) { "[✓]" } else { "[ ]" }
$statusText = if ($status) { "IMPLEMENTED" } else { "PENDING" }
$statusColor = if ($status) { "Green" } else { "Yellow" }
Write-ColorOutput $statusColor "$statusIcon $($item.Name)"
Write-Output " $($item.Description)"
Write-Output " File: $($item.File)"
Write-Output " Status: $statusText"
Write-Output ""
if ($status) { $completed++ }
}
$total = $Items.Count
$percentage = [math]::Round(($completed / $total) * 100, 1)
Write-Info "Progress: $completed/$total ($percentage%)"
return @{
Completed = $completed
Total = $total
Percentage = $percentage
}
}
function Show-FullStatus {
Write-Info "`n========================================"
Write-Info " DEPLOYMENT ENHANCEMENT STATUS"
Write-Info "========================================`n"
$phase1Stats = Show-PhaseStatus "Phase 1 - Near Term" $Phase1Items 1
Write-Output ""
$phase2Stats = Show-PhaseStatus "Phase 2 - Medium Term" $Phase2Items 2
Write-Output ""
$phase3Stats = Show-PhaseStatus "Phase 3 - Long Term" $Phase3Items 3
Write-Info "`n========================================"
Write-Info " OVERALL PROGRESS"
Write-Info "========================================`n"
$totalCompleted = $phase1Stats.Completed + $phase2Stats.Completed + $phase3Stats.Completed
$totalItems = $phase1Stats.Total + $phase2Stats.Total + $phase3Stats.Total
$overallPercentage = [math]::Round(($totalCompleted / $totalItems) * 100, 1)
Write-Info "Total: $totalCompleted/$totalItems ($overallPercentage%)"
Write-Info "Phase 1: $($phase1Stats.Completed)/$($phase1Stats.Total) ($($phase1Stats.Percentage)%)"
Write-Info "Phase 2: $($phase2Stats.Completed)/$($phase2Stats.Total) ($($phase2Stats.Percentage)%)"
Write-Info "Phase 3: $($phase3Stats.Completed)/$($phase3Stats.Total) ($($phase3Stats.Percentage)%)"
}
function Check-BuildStatus {
Write-Info "`nChecking build status...`n"
$buildSuccess = $false
$testSuccess = $false
# Check if zig is available
try {
$zigVersion = zig version 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Success "✓ Zig compiler found"
Write-Output " $zigVersion"
} else {
Write-Warning "⚠ Zig compiler not found or error"
}
} catch {
Write-Warning "⚠ Zig compiler not found in PATH"
}
# Try to build
Write-Info "`nAttempting build check..."
try {
$buildOutput = zig build 2>&1 | Out-String
if ($LASTEXITCODE -eq 0) {
Write-Success "✓ Build successful"
$buildSuccess = $true
} else {
Write-Warning "⚠ Build failed (this may be due to dependency issues)"
Write-Output $buildOutput
}
} catch {
Write-Warning "⚠ Could not run build check"
}
# Try to run tests
Write-Info "`nAttempting test check..."
try {
$testOutput = zig build test 2>&1 | Out-String
if ($LASTEXITCODE -eq 0) {
Write-Success "✓ Tests passed"
$testSuccess = $true
} else {
Write-Warning "⚠ Tests failed"
Write-Output $testOutput
}
} catch {
Write-Warning "⚠ Could not run tests"
}
return @{
BuildSuccess = $buildSuccess
TestSuccess = $testSuccess
}
}
# Main execution
if ($Status) {
Show-FullStatus
Check-BuildStatus
exit
}
if ($Check) {
$buildStatus = Check-BuildStatus
Write-Info "`nBuild Status: $(if ($buildStatus.BuildSuccess) { 'SUCCESS' } else { 'FAILED/UNKNOWN' })"
Write-Info "Test Status: $(if ($buildStatus.TestSuccess) { 'PASSED' } else { 'FAILED/UNKNOWN' })"
exit
}
if ($Phase1) {
Show-PhaseStatus "Phase 1 - Near Term" $Phase1Items 1
exit
}
if ($Phase2) {
Show-PhaseStatus "Phase 2 - Medium Term" $Phase2Items 2
exit
}
if ($Phase3) {
Show-PhaseStatus "Phase 3 - Long Term" $Phase3Items 3
exit
}
# Default: show all
if ($All -or (-not $Phase1 -and -not $Phase2 -and -not $Phase3 -and -not $Check -and -not $Status)) {
Show-FullStatus
}
Write-Info "`nUse -Help for usage information"
Write-Info "Examples:"
Write-Info " .\deployment_tracker.ps1 # Show all status"
Write-Info " .\deployment_tracker.ps1 -Phase1 # Show Phase 1 only"
Write-Info " .\deployment_tracker.ps1 -Check # Check build/test status"
Write-Info " .\deployment_tracker.ps1 -Status # Full status + build check"