From 81455acb78c27712f653ae8eb412dff7d0cdeb8f Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Thu, 30 Jul 2026 17:30:35 -0700 Subject: [PATCH 1/7] condition upload to lavapipe --- azure-pipelines.yml | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e863652250..ebe6d14da4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,29 @@ resources: - repo: self stages: + +- stage: OffloadGate + dependsOn: [] + jobs: + - job: gate + pool: + vmImage: ubuntu-latest + steps: + - checkout: none + - bash: | + run=true + if [ "$(Build.Reason)" = "PullRequest" ]; then + run=false + labels=$(curl -sf "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" | python3 -c "import sys, json; print(' '.join(l['name'] for l in json.load(sys.stdin)))") + for l in $labels; do [ "$l" = "run-offload-tests" ] && run=true; done + fi + echo "Build.Reason=$(Build.Reason) run=$run" + echo "##vso[task.setvariable variable=run;isOutput=true]$run" + name: decide + - stage: Build + dependsOn: + - OffloadGate jobs: - job: Windows timeoutInMinutes: 180 @@ -32,6 +54,7 @@ stages: HLSL_SRC_DIR: '$(Build.SourcesDirectory)' HLSL_BLD_DIR: '$(Agent.BuildDirectory)' platform: x64 + uploadArtifact: $[ stageDependencies.OffloadGate.gate.outputs['decide.run'] ] strategy: matrix: @@ -105,7 +128,7 @@ stages: condition: and(succeeded(), ne(variables['artifactName'], '')) - task: PublishPipelineArtifact@1 displayName: 'Publish DXC binaries' - condition: and(succeeded(), ne(variables['artifactName'], '')) + condition: and(succeeded(), ne(variables['artifactName'], ''), eq(variables['uploadArtifact'], 'true')) inputs: targetPath: '$(Build.ArtifactStagingDirectory)\dxc' artifact: '$(artifactName)' @@ -211,25 +234,6 @@ stages: testResultsFiles: '**/testresults.xunit.xml' condition: succeededOrFailed() -- stage: OffloadGate - dependsOn: [] - jobs: - - job: gate - pool: - vmImage: ubuntu-latest - steps: - - checkout: none - - bash: | - run=true - if [ "$(Build.Reason)" = "PullRequest" ]; then - run=false - labels=$(curl -sf "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" | python3 -c "import sys, json; print(' '.join(l['name'] for l in json.load(sys.stdin)))") - for l in $labels; do [ "$l" = "run-offload-tests" ] && run=true; done - fi - echo "Build.Reason=$(Build.Reason) run=$run" - echo "##vso[task.setvariable variable=run;isOutput=true]$run" - name: decide - - stage: OffloadTests displayName: 'Offload tests' dependsOn: From 39540611914134d0a19a93ba8aa474e701815f9a Mon Sep 17 00:00:00 2001 From: joaosaffran Date: Thu, 30 Jul 2026 18:33:35 -0700 Subject: [PATCH 2/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ebe6d14da4..2d2fd6cb3d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,6 +43,7 @@ stages: - stage: Build dependsOn: - OffloadGate + condition: succeededOrFailed() jobs: - job: Windows timeoutInMinutes: 180 From 63a9694a6711ea9b045a522e28d161185b05091c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Fri, 31 Jul 2026 11:45:14 -0700 Subject: [PATCH 3/7] address damyan comment --- azure-pipelines.yml | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ebe6d14da4..c1bd4bfd63 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,28 +21,7 @@ resources: stages: -- stage: OffloadGate - dependsOn: [] - jobs: - - job: gate - pool: - vmImage: ubuntu-latest - steps: - - checkout: none - - bash: | - run=true - if [ "$(Build.Reason)" = "PullRequest" ]; then - run=false - labels=$(curl -sf "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" | python3 -c "import sys, json; print(' '.join(l['name'] for l in json.load(sys.stdin)))") - for l in $labels; do [ "$l" = "run-offload-tests" ] && run=true; done - fi - echo "Build.Reason=$(Build.Reason) run=$run" - echo "##vso[task.setvariable variable=run;isOutput=true]$run" - name: decide - - stage: Build - dependsOn: - - OffloadGate jobs: - job: Windows timeoutInMinutes: 180 @@ -54,7 +33,6 @@ stages: HLSL_SRC_DIR: '$(Build.SourcesDirectory)' HLSL_BLD_DIR: '$(Agent.BuildDirectory)' platform: x64 - uploadArtifact: $[ stageDependencies.OffloadGate.gate.outputs['decide.run'] ] strategy: matrix: @@ -126,9 +104,21 @@ stages: } displayName: 'Stage DXC binaries' condition: and(succeeded(), ne(variables['artifactName'], '')) + - pwsh: | + $run = $true + if ("$(Build.Reason)" -eq "PullRequest") { + $run = $false + $labels = Invoke-RestMethod "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" + if ($labels.name -contains "run-offload-tests") { $run = $true } + } + Write-Host "Build.Reason=$(Build.Reason) run=$run" + Write-Host "##vso[task.setvariable variable=run;isOutput=true]$($run.ToString().ToLower())" + name: decide + displayName: 'Decide whether to run offload tests' + condition: and(succeeded(), ne(variables['artifactName'], '')) - task: PublishPipelineArtifact@1 displayName: 'Publish DXC binaries' - condition: and(succeeded(), ne(variables['artifactName'], ''), eq(variables['uploadArtifact'], 'true')) + condition: and(succeeded(), ne(variables['artifactName'], ''), eq(variables['decide.run'], 'true')) inputs: targetPath: '$(Build.ArtifactStagingDirectory)\dxc' artifact: '$(artifactName)' @@ -238,8 +228,7 @@ stages: displayName: 'Offload tests' dependsOn: - Build - - OffloadGate - condition: and(succeededOrFailed(), eq(dependencies.OffloadGate.outputs['gate.decide.run'], 'true')) + condition: and(succeededOrFailed(), eq(dependencies.Build.outputs['Windows.VS2022_Release.decide.run'], 'true')) jobs: - job: Offload From e85b4056e541bee82a47497f555c02f46057ea5c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Fri, 31 Jul 2026 15:00:17 -0700 Subject: [PATCH 4/7] clean up --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3d6540d324..39b9d133d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,6 @@ resources: - repo: self stages: - - stage: Build condition: succeededOrFailed() jobs: From d2c3f8471ccc9b7d59ba3505bd5667788b5f2ba8 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Fri, 31 Jul 2026 15:10:59 -0700 Subject: [PATCH 5/7] improve error handling --- azure-pipelines.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 39b9d133d1..f63d60796d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -108,8 +108,12 @@ stages: $run = $true if ("$(Build.Reason)" -eq "PullRequest") { $run = $false - $labels = Invoke-RestMethod "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" - if ($labels.name -contains "run-offload-tests") { $run = $true } + try { + $labels = Invoke-RestMethod "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" -ErrorAction Stop + if ($labels.name -contains "run-offload-tests") { $run = $true } + } catch { + Write-Warning "Unable to check pull request labels; skipping offload tests: $_" + } } Write-Host "Build.Reason=$(Build.Reason) run=$run" Write-Host "##vso[task.setvariable variable=run;isOutput=true]$($run.ToString().ToLower())" From d9353d9ff626139c9fa31bafdb7b56db063966da Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Fri, 31 Jul 2026 16:01:58 -0700 Subject: [PATCH 6/7] address damyan comments --- azure-pipelines.yml | 50 +++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f63d60796d..2e2939b286 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,6 @@ resources: stages: - stage: Build - condition: succeededOrFailed() jobs: - job: Windows timeoutInMinutes: 180 @@ -40,19 +39,34 @@ stages: configuration: Release spirvBuildFlag: -spirvtest artifactName: dxc_spirv_release + offloadCandidate: true VS2022_Debug: configuration: Debug spirvBuildFlag: -spirvtest - artifactName: '' VS2022_Release_NoSPIRV: configuration: Release spirvBuildFlag: '' - artifactName: '' steps: - checkout: self clean: true submodules: true + - pwsh: | + $run = $true + if ("$(Build.Reason)" -eq "PullRequest") { + $run = $false + try { + $labels = Invoke-RestMethod "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" -ErrorAction Stop + if ($labels.name -contains "run-offload-tests") { $run = $true } + } catch { + Write-Warning "Unable to check pull request labels; skipping offload tests: $_" + } + } + Write-Host "Build.Reason=$(Build.Reason) runOffloadTests=$run" + Write-Host "##vso[task.setvariable variable=runOffloadTests;isOutput=true]$($run.ToString().ToLower())" + name: decide + displayName: 'Decide whether to run offload tests' + condition: and(succeeded(), eq(variables['offloadCandidate'], 'true')) - script: | call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR% call utils\hct\hctbuild.cmd -vs2022 -$(platform) -$(configuration) -show-cmake-log $(spirvBuildFlag) -warp-nuget-version 1.0.16.1 @@ -103,31 +117,14 @@ stages: if (Test-Path "$bin\$f") { Copy-Item "$bin\$f" $dst } else { throw "Required file not found: $bin\$f" } } displayName: 'Stage DXC binaries' - condition: and(succeeded(), ne(variables['artifactName'], '')) - - pwsh: | - $run = $true - if ("$(Build.Reason)" -eq "PullRequest") { - $run = $false - try { - $labels = Invoke-RestMethod "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" -ErrorAction Stop - if ($labels.name -contains "run-offload-tests") { $run = $true } - } catch { - Write-Warning "Unable to check pull request labels; skipping offload tests: $_" - } - } - Write-Host "Build.Reason=$(Build.Reason) run=$run" - Write-Host "##vso[task.setvariable variable=run;isOutput=true]$($run.ToString().ToLower())" - name: decide - displayName: 'Decide whether to run offload tests' - condition: and(succeeded(), ne(variables['artifactName'], '')) + condition: and(succeeded(), eq(variables['decide.runOffloadTests'], 'true')) - task: PublishPipelineArtifact@1 displayName: 'Publish DXC binaries' - condition: and(succeeded(), ne(variables['artifactName'], ''), eq(variables['decide.run'], 'true')) + condition: and(succeeded(), eq(variables['decide.runOffloadTests'], 'true')) inputs: targetPath: '$(Build.ArtifactStagingDirectory)\dxc' artifact: '$(artifactName)' - - job: Nix timeoutInMinutes: 165 @@ -228,14 +225,9 @@ stages: testResultsFiles: '**/testresults.xunit.xml' condition: succeededOrFailed() -- stage: OffloadTests - displayName: 'Offload tests' - dependsOn: - - Build - condition: and(succeededOrFailed(), eq(dependencies.Build.outputs['Windows.VS2022_Release.decide.run'], 'true')) - - jobs: - job: Offload + dependsOn: Windows + condition: and(succeededOrFailed(), eq(dependencies.Windows.outputs['VS2022_Release.decide.runOffloadTests'], 'true')) timeoutInMinutes: 180 pool: vmImage: windows-2025 From 781eb4e1d15e171bd33918f8d89379fb711b33ee Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Fri, 31 Jul 2026 16:03:57 -0700 Subject: [PATCH 7/7] clean up --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2e2939b286..1190403cfd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -125,6 +125,7 @@ stages: targetPath: '$(Build.ArtifactStagingDirectory)\dxc' artifact: '$(artifactName)' + - job: Nix timeoutInMinutes: 165