Skip to content

fix(hud): guard device ownership and concurrent dispatch #69

fix(hud): guard device ownership and concurrent dispatch

fix(hud): guard device ownership and concurrent dispatch #69

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build Aurora (No Signing) / 构建 Aurora(未签名)
on:
workflow_dispatch:
push:
branches: [ "aurora", "Compatibility-fixes" ]
# pull_request:
# branches: [ "master" ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Configuration type to build.
BUILD_CONFIGURATION: Release
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
environment: Build
steps:
- name: Checkout / 检出源码
uses: actions/checkout@v6
with:
submodules: 'true'
- name: Extract version / 读取版本号
id: get_version
working-directory: ${{ github.workspace }}
shell: powershell
run: |
$resourceFile = ".\OptiScaler\resource.h"
if (-Not (Test-Path $resourceFile)) {
Write-Error "File not found: $resourceFile"
exit 1
}
$resourceLines = Get-Content $resourceFile
$auroraLine = $resourceLines | Select-String -Pattern '^\s*#define\s+VER_AURORA_VERSION\s+"([^"]+)"' | Select-Object -First 1
if (-Not $auroraLine) {
Write-Error "VER_AURORA_VERSION not found in $resourceFile"
exit 1
}
$auroraVersion = $auroraLine.Matches[0].Groups[1].Value
$version = "v$auroraVersion"
$date = Get-Date -Format "yyyyMMdd"
$outputFileName = "OptiScaler_Aurora_${version}_${date}"
if ($env:GITHUB_REF_NAME -eq 'Compatibility-fixes') {
$outputFileName += "_compat_" + $env:GITHUB_SHA.Substring(0,8)
}
Write-Output "Generated Filename: $outputFileName"
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"filename=$outputFileName" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
continue-on-error: false
- name: Debug outputs / 检查版本信息
run: |
echo "Version: ${{ steps.get_version.outputs.version }}"
echo "Filename: ${{ steps.get_version.outputs.filename }}"
- name: Add MSBuild to PATH / 配置 MSBuild
uses: microsoft/setup-msbuild@v3
- name: Build / 构建
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /verbosity:minimal
- name: Add README / 添加说明文档
run: Copy-Item ${{ github.workspace }}\README.md ${{ github.workspace }}\x64\Release\a\README.md
- name: Verify official runtime inventory
shell: powershell
run: .\scripts\verify_runtime_inventory.ps1
# Streamline 2.14.1 is included in every Aurora package.
- name: Add Streamline 2.14.1 / 添加 Streamline 2.14.1
shell: powershell
run: |
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\streamline"
New-Item -ItemType Directory -Force -Path $target | Out-Null
Copy-Item ${{ github.workspace }}\dist\streamline\* $target
# Official production DLSS 310.9.1 runtimes are included in every Aurora package.
- name: Add DLSS 310.9.1 / 添加 DLSS 310.9.1 运行库
shell: powershell
run: |
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler"
New-Item -ItemType Directory -Force -Path $target | Out-Null
Copy-Item ${{ github.workspace }}\dist\nvngx\* $target
Copy-Item "${{ github.workspace }}\dist\runtime_versions.json" "$target\runtime_versions.json"
.\scripts\verify_runtime_inventory.ps1 -PackageRoot "${{ github.workspace }}\x64\Release\a"
# nvngx_dlssnr.dll is too large for normal Git and public forks cannot upload new LFS objects.
# Keep it as a dedicated Release asset, download it at build time, and verify the exact tested file.
- name: Add DLSS Neural Rendering runtime / 添加 DLSS 神经渲染运行库
shell: powershell
run: |
$url = "https://github.com/abc354402600/OptiScaler-Aurora/releases/download/aurora-runtime-dlssnr-310.8/nvngx_dlssnr.dll"
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\nvngx_dlssnr.dll"
$expectedSha256 = "e67dee209320cdafe0e93e45675d7aa34323a53acc57a72b2e40a181581c989a"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $url -OutFile $target
$actualSha256 = (Get-FileHash $target -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualSha256 -ne $expectedSha256) {
Write-Error "nvngx_dlssnr.dll SHA256 mismatch. Expected $expectedSha256, got $actualSha256"
exit 1
}
Write-Output "DLSS Neural Rendering runtime verified: $actualSha256"
- name: Add Runtime Sync / 添加运行库同步工具
shell: powershell
run: |
Copy-Item "${{ github.workspace }}\dist\runtime_sync\runtime_sync.ps1" "${{ github.workspace }}\x64\Release\a\runtime_sync.ps1"
Copy-Item "${{ github.workspace }}\dist\runtime_sync\Check_DLSS_Runtime.bat" "${{ github.workspace }}\x64\Release\a\Check_DLSS_Runtime.bat"
- name: Test runtime version preservation
shell: powershell
run: .\tests\test_runtime_no_downgrade.ps1
- name: Test compatibility lifecycle guards
shell: powershell
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vcvars = Join-Path $vs 'VC\Auxiliary\Build\vcvars64.bat'
foreach ($name in @('Aurora_DLSSG_Frame_Guard_Tests','Aurora_Provider_Handle_Tests','Aurora_Input_Lock_Tests','Aurora_Streamline_Binding_Tests','Aurora_Provider_Create_Tests','Aurora_Provider_Publication_Tests','Aurora_Native_Device_Tests','Aurora_Provider_Publication_Allocation_Tests')) {
$command = 'call "' + $vcvars + '" && cl /nologo /EHsc /std:c++20 /I OptiScaler tests\' + $name + '.cpp /Fe:x64\' + $name + '.exe && x64\' + $name + '.exe'
& $env:ComSpec /d /c $command
if ($LASTEXITCODE) { throw "Compatibility guard test failed: $name" }
}
foreach ($script in @('test_hud_copy_failure.py','test_shutdown_routing.py','test_provider_publication_routes.py','test_provider_dll_boundary.py','test_combo_release.py','test_combo_shutdown.py','test_native_operation_routes.py','test_native_module_publication.py','test_native_init_scopes.py', 'test_exported_init_chains.py','test_ngx_init_paths.py','test_ngx_init_metadata.py','test_provider_release_admission.py','test_provider_call_admission.py','test_provider_init_footprint.py','test_provider_handle_api.py','test_upstream_resource_guards.py','test_provider_settings.py','test_provider_shutdown_drain.py','test_ffx_release.py','test_ffx_create.py','test_combo_create.py','test_provider_init_allocation.py')) {
$command = 'call "' + $vcvars + '" && python tests\' + $script + ' --compiler cl'
& $env:ComSpec /d /c $command
if ($LASTEXITCODE) { throw "Compatibility routing test failed: $script" }
}
- name: Package Aurora / 打包 Aurora
shell: powershell
run: |
$zipName = "${{ steps.get_version.outputs.filename }}.7z"
7z a -r ${{ github.workspace }}\$zipName ${{ github.workspace }}\x64\Release\a\*.*
continue-on-error: false
- name: Upload Aurora artifact / 上传 Aurora 构建产物
uses: actions/upload-artifact@v7.0.0
with:
name: '${{ steps.get_version.outputs.filename }}'
path: '${{ github.workspace }}\${{ steps.get_version.outputs.filename }}.7z'
archive: false
compression-level: 0
if-no-files-found: error