-
Notifications
You must be signed in to change notification settings - Fork 85
Cross-platform HW VDF client builds (Linux/macOS arm64/Windows) + callback/prover hardening #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
f4bd736
Windows asm/ABI and runtime fixes
hoffmang9 e7f37d7
CMake: Windows + perf experiment options
hoffmang9 003ecf3
CI: perf experiments and Windows benchmarking
hoffmang9 b1d9057
ci: streamline test workflow
hoffmang9 71121ab
build: remove perf-only CMake toggles
hoffmang9 679a387
core: gate AVX logging behind env flag
hoffmang9 70c50ac
asm: document Windows ABI restore
hoffmang9 e89c805
docs: remove Windows perf notes
hoffmang9 980b697
Nit note in README and clean up some language in test.yaml
hoffmang9 d04e5fb
Fix step name
hoffmang9 ad87252
various workflow clean ups and fix AVX512 flag
hoffmang9 5a7ee42
fix windows runners in test.yaml
hoffmang9 880d11f
more cmake instruction issues
hoffmang9 f3a5229
harden finding boost on Mac intel
hoffmang9 d713c5e
now cmake isn't always there...
hoffmang9 8fc91e6
more install cmake
hoffmang9 313c353
fix ASAN, remove TSAN for windows runners
hoffmang9 a9c401f
initiate windows dev env on ASAN runner
hoffmang9 e4d821e
more ASAN windows issues - harden brew handling in cibuildwheel
hoffmang9 7df51ce
giving up on ASAN
hoffmang9 f0e2ce6
Add required linker flag for Windows asm - fix unchecked vector access
hoffmang9 dc36ee8
potentially fix bug in the 2weso test
hoffmang9 a72c490
consolidate 2weso fail-hunting phases 40-43
hoffmang9 78092a2
2weso fail hunting 44
hoffmang9 5f9df6c
2weso fail hunting 45
hoffmang9 3a5dae4
2weso fail hunting 46
hoffmang9 5b74a88
cleanup: strip 2weso debug scaffolding after Windows root-cause isola…
hoffmang9 b364b60
ci - add an asm path to the c++ test path, fix HW headers
hoffmang9 651ee88
ci - bring windows back around to main ubuntu/macos testing
hoffmang9 34223d3
address cursor review issues
hoffmang9 ba2c55c
everything on windows should take the asm path
hoffmang9 e5db303
something about the windows asm path is broken
hoffmang9 f9b2efa
and we are off again searching for the asm issue
hoffmang9 14bf670
cache all the things and chase the asm issue
hoffmang9 52e9b56
look closer at the ubuntu vs windows asm changes
hoffmang9 bde8394
Consolidate Windows asm investigation commits 1-17.
hoffmang9 0e07a15
Fix Windows asm CI and align optimized test coverage (#304)
hoffmang9 9e88b65
cleanup: finalize Windows asm follow-ups and include hygiene
hoffmang9 3f22222
fix windows avx512 add table rip-relative access
hoffmang9 73f2585
Remove unused max_test_iteration in 2weso_test.
hoffmang9 5645703
fix gcd_unsigned compare against end_index
hoffmang9 afcd784
Harden callback state synchronization and update build/runtime tuning…
hoffmang9 c3e10d2
Guard POSIX-only emulator hardware targets on Windows.
hoffmang9 16b5466
Initialize FastAlgorithmCallback forms_capacity.
hoffmang9 96abd39
Harden macOS/Windows gcd_unsigned dispatch bounds check.
hoffmang9 f5a7eef
Define CHIAOSX for macOS CMake asm generation.
hoffmang9 01e8da9
Refine Windows asm argument handling and remove unused SEH include.
hoffmang9 24de3c8
ci(hw): add cross-platform HW workflow and FT4222 installers.
hoffmang9 0a6a595
build(hw): refactor HW target wiring for cross-platform CMake and Make.
hoffmang9 9228710
core: reduce two-weso hot-path contention and fix Windows weak-symbol…
hoffmang9 79ec9d8
hw-runtime: harden emulator and driver portability paths.
hoffmang9 059b441
hw-tools: stabilize client, proof, and test integration on Windows.
hoffmang9 0a1e1cf
core: apply low-level portability cleanup for allocation and bqfc cod…
hoffmang9 b040ec1
hw-client: fix bytes log format specifiers.
hoffmang9 4e0745e
hw-client: initialize sock with kInvalidSocket.
hoffmang9 4475f5e
Merge origin/main into hw-vdf-macos-arm64.
hoffmang9 7220cac
hw-build: fix HW smoke regressions after main merge.
hoffmang9 6be75ad
hw-proof: align Prover GetForm ABI across prover stacks.
hoffmang9 7497450
callback: restore one-weso bounds guard in iteration callback.
hoffmang9 4ab97b0
hw-build: align Windows HW runner with other smoke checks.
hoffmang9 61e9df8
hw-client: make hw_vdf_client option parsing Windows-safe.
hoffmang9 43e7d7d
hw-client: use Windows-compatible signal handlers in hw_vdf_client.
hoffmang9 e7441db
callback: harden one-weso capacity calculation.
hoffmang9 173222e
callback: publish two-weso switch state with release semantics.
hoffmang9 54e60ef
parameters: gate AVX runtime flags on OS state.
hoffmang9 c5414c4
parameters: keep AVX force flags OS-state safe.
hoffmang9 c0e4db7
callback: atomically snapshot two-weso switch metadata
hoffmang9 a3abd4e
hw-client: balance Winsock startup/cleanup on early exits
hoffmang9 443ff5e
callback: lock two-weso transition publication
hoffmang9 8638d3a
hw-client: parse positional args independently from flags
hoffmang9 dbe773c
hw-client: reject invalid positional ports
hoffmang9 6fc4528
hw-client: harden Winsock cleanup with RAII
hoffmang9 54f7b8b
callback: harden two-weso transition snapshot semantics
hoffmang9 06db65d
Fix "One Definition Rule" Violation for Prover::GetForm
xearl4 3fc72ee
prover: align GetForm return semantics across stacks
hoffmang9 ab7b7c7
asm: add Linux track_asm addressing A/B benchmark path
hoffmang9 4a87a5e
ci: fix Linux benchmark clean target and shorten Ubuntu 2weso
hoffmang9 8d0d0d3
ci+asm: revert temporary addressing experiment and restore Linux abso…
hoffmang9 76b8207
merge main and adopt canonical prover headers for hw builds
hoffmang9 e42cabd
hw-client: link prover_runtime in makefile hw targets
hoffmang9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| Param( | ||
| [Parameter(Mandatory = $false)] | ||
| [ValidateSet("install", "clean")] | ||
| [string]$Action = "install" | ||
| ) | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| $RootDir = Resolve-Path (Join-Path $PSScriptRoot "..") | ||
| $SrcDir = Join-Path $RootDir "src" | ||
| $WorkDir = Join-Path $SrcDir "libft4222" | ||
| $HwDir = Join-Path $SrcDir "hw\libft4222" | ||
|
|
||
| $ZipUrl = "https://download.chia.net/vdf/LibFT4222-v1.4.8.zip" | ||
| $ZipPath = Join-Path $WorkDir "LibFT4222-v1.4.8.zip" | ||
| $ExtractDir = Join-Path $WorkDir "extract" | ||
|
|
||
| Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
|
|
||
| function Ensure-Dir { | ||
| param([string]$Path) | ||
| if (-not (Test-Path $Path)) { | ||
| New-Item -ItemType Directory -Path $Path | Out-Null | ||
| } | ||
| } | ||
|
|
||
| function Choose-Best { | ||
| param([System.IO.FileInfo[]]$Items) | ||
| if (-not $Items -or $Items.Count -eq 0) { | ||
| return $null | ||
| } | ||
| $preferred = $Items | Where-Object { $_.FullName -match "(x64|amd64|win64)" } | ||
| if ($preferred -and $preferred.Count -gt 0) { | ||
| return $preferred[0] | ||
| } | ||
| return $Items[0] | ||
| } | ||
|
|
||
| function Find-Header { | ||
| param( | ||
| [string]$BaseName, | ||
| [string[]]$Alternates = @() | ||
| ) | ||
| $names = @($BaseName) + $Alternates | ||
| foreach ($name in $names) { | ||
| $match = Get-ChildItem -Path $ExtractDir -Recurse -File | | ||
| Where-Object { $_.Name -ieq $name } | | ||
| Select-Object -First 1 | ||
| if ($match) { | ||
| return $match | ||
| } | ||
| } | ||
| return $null | ||
| } | ||
|
|
||
| function Test-ZipValid { | ||
| param([string]$Path) | ||
| if (-not (Test-Path $Path)) { | ||
| return $false | ||
| } | ||
| $zip = $null | ||
| try { | ||
| $zip = [System.IO.Compression.ZipFile]::OpenRead($Path) | ||
| $null = $zip.Entries.Count | ||
| return $true | ||
| } catch { | ||
| return $false | ||
| } finally { | ||
| if ($zip) { | ||
| $zip.Dispose() | ||
| } | ||
| } | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| function Download-With-Retry { | ||
| param( | ||
| [string]$Url, | ||
| [string]$Path, | ||
| [int]$Attempts = 3 | ||
| ) | ||
| for ($attempt = 1; $attempt -le $Attempts; $attempt++) { | ||
| if (Test-Path $Path) { | ||
| Remove-Item $Path -Force | ||
| } | ||
| try { | ||
| Invoke-WebRequest -Uri $Url -OutFile $Path -MaximumRedirection 5 | ||
| } catch { | ||
| if ($attempt -eq $Attempts) { | ||
| throw | ||
| } | ||
| Start-Sleep -Seconds (2 * $attempt) | ||
| continue | ||
| } | ||
| if (Test-ZipValid $Path) { | ||
| return | ||
| } | ||
| Write-Warning "Downloaded zip failed validation (attempt $attempt/$Attempts)." | ||
| Start-Sleep -Seconds (2 * $attempt) | ||
| } | ||
| throw "Failed to download a valid zip from $Url after $Attempts attempts." | ||
| } | ||
|
|
||
| function Install-LibFT4222 { | ||
| Ensure-Dir $WorkDir | ||
| if (Test-Path $ExtractDir) { | ||
| Remove-Item $ExtractDir -Recurse -Force | ||
| } | ||
|
|
||
| Download-With-Retry -Url $ZipUrl -Path $ZipPath -Attempts 3 | ||
| Expand-Archive -Path $ZipPath -DestinationPath $ExtractDir -Force | ||
|
|
||
| $headers = @( | ||
| @{ Name = "libft4222.h"; Alternates = @() }, | ||
| @{ Name = "ftd2xx.h"; Alternates = @() }, | ||
| @{ Name = "WinTypes.h"; Alternates = @("wintypes.h") } | ||
| ) | ||
| foreach ($header in $headers) { | ||
| $match = Find-Header -BaseName $header.Name -Alternates $header.Alternates | ||
| if (-not $match) { | ||
| if ($header.Name -eq "WinTypes.h") { | ||
| $stubPath = Join-Path $WorkDir $header.Name | ||
| @" | ||
| #pragma once | ||
| #ifdef _WIN32 | ||
| #include <windows.h> | ||
| #endif | ||
| "@ | Set-Content -Path $stubPath -Encoding ASCII | ||
| continue | ||
| } | ||
| throw "Missing required header: $($header.Name)" | ||
| } | ||
| Copy-Item $match.FullName -Destination (Join-Path $WorkDir $header.Name) -Force | ||
| } | ||
|
|
||
| $libftLib = Choose-Best (Get-ChildItem -Path $ExtractDir -Recurse -Filter "libft4222*.lib") | ||
| $ftdLib = Choose-Best (Get-ChildItem -Path $ExtractDir -Recurse -Filter "ftd2xx*.lib") | ||
| $libftDll = Choose-Best (Get-ChildItem -Path $ExtractDir -Recurse -Filter "libft4222*.dll") | ||
| $ftdDll = Choose-Best (Get-ChildItem -Path $ExtractDir -Recurse -Filter "ftd2xx*.dll") | ||
|
|
||
| if (-not $libftLib -or -not $ftdLib) { | ||
| throw "Missing required .lib files in extracted package" | ||
| } | ||
| if (-not $libftDll -or -not $ftdDll) { | ||
| throw "Missing required .dll files in extracted package" | ||
| } | ||
|
|
||
| Copy-Item $libftLib.FullName -Destination (Join-Path $WorkDir "libft4222.lib") -Force | ||
| Copy-Item $ftdLib.FullName -Destination (Join-Path $WorkDir "ftd2xx.lib") -Force | ||
| Copy-Item $libftDll.FullName -Destination (Join-Path $WorkDir "libft4222.dll") -Force | ||
| Copy-Item $ftdDll.FullName -Destination (Join-Path $WorkDir "ftd2xx.dll") -Force | ||
|
|
||
| if (Test-Path $HwDir) { | ||
| Remove-Item $HwDir -Recurse -Force | ||
| } | ||
| Ensure-Dir $HwDir | ||
|
|
||
| Copy-Item (Join-Path $WorkDir "*.h") -Destination $HwDir -Force | ||
| Copy-Item (Join-Path $WorkDir "*.lib") -Destination $HwDir -Force | ||
| Copy-Item (Join-Path $WorkDir "*.dll") -Destination $HwDir -Force | ||
| } | ||
|
|
||
| function Clean-LibFT4222 { | ||
| if (Test-Path $WorkDir) { | ||
| Remove-Item $WorkDir -Recurse -Force | ||
| } | ||
| if (Test-Path $HwDir) { | ||
| Remove-Item $HwDir -Recurse -Force | ||
| } | ||
| } | ||
|
|
||
| switch ($Action) { | ||
| "install" { Install-LibFT4222 } | ||
| "clean" { Clean-LibFT4222 } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.