Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ jobs:
echo "::error::The release tag does not point to the qualified commit."
exit 1
fi
for id in dxsharp.native dxsharp.assets dxsharp.core dxsharp.directml dxsharp.framework.desktop; do
url="https://api.nuget.org/v3-flatcontainer/$id/$RELEASE_VERSION/$id.$RELEASE_VERSION.nupkg"
for id in $(python -c 'from build.release_packages import PACKAGE_IDS; print(" ".join(PACKAGE_IDS))'); do
lower_id="${id,,}"
url="https://api.nuget.org/v3-flatcontainer/$lower_id/$RELEASE_VERSION/$lower_id.$RELEASE_VERSION.nupkg"
status=$(curl --silent --show-error --head --max-time 30 --output /dev/null --write-out '%{http_code}' "$url")
if [[ "$status" != 404 ]]; then
echo "::error::Expected $id $RELEASE_VERSION to be unpublished, got HTTP $status."
Expand All @@ -201,13 +202,13 @@ jobs:
env:
NUGET_API_KEY: ${{ steps.nuget.outputs.NUGET_API_KEY }}
run: |
for id in DXSharp.Native DXSharp.Assets DXSharp.Core DXSharp.DirectML DXSharp.Framework.Desktop DXSharp.Framework; do
for id in $(python -c 'from build.release_packages import PACKAGE_IDS; print(" ".join(PACKAGE_IDS))'); do
dotnet nuget push "candidate/$id.$RELEASE_VERSION.nupkg" \
--api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
done
- name: Record successful NuGet upload on the release
run: |
cp "doc/releases/$RELEASE_VERSION.md" published-notes.md
printf '\nNuGet.org accepted the six packages and their symbols from [this publishing run](%s/%s/actions/runs/%s). Feed indexing and symbol validation may take additional time.\n' \
printf '\nNuGet.org accepted the qualified packages and their symbols from [this publishing run](%s/%s/actions/runs/%s). Feed indexing and symbol validation may take additional time.\n' \
"$GITHUB_SERVER_URL" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" >> published-notes.md
gh release edit "v$RELEASE_VERSION" --notes-file published-notes.md
30 changes: 30 additions & 0 deletions DXSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CharacterLab", "samples\Cha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CharacterLab.Native", "samples\CharacterLab.Native\CharacterLab.Native.csproj", "{3F26D680-7549-4ED0-B6E6-F940B2E2E8C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CharacterLab.Wpf", "samples\CharacterLab.Wpf\CharacterLab.Wpf.csproj", "{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DXSharp.Framework.Wpf", "src\DXSharp.Framework.Wpf\DXSharp.Framework.Wpf.csproj", "{CA095DE4-9BC3-49E4-A764-D4406AA4D795}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -482,6 +486,30 @@ Global
{F2B18F42-2A58-413A-921F-71648DB0C250}.Release|x64.Build.0 = Release|x64
{F2B18F42-2A58-413A-921F-71648DB0C250}.Release|x86.ActiveCfg = Release|x86
{F2B18F42-2A58-413A-921F-71648DB0C250}.Release|x86.Build.0 = Release|x86
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|x64.ActiveCfg = Debug|x64
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|x64.Build.0 = Debug|x64
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|x86.ActiveCfg = Debug|x86
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Debug|x86.Build.0 = Debug|x86
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|Any CPU.Build.0 = Release|Any CPU
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|x64.ActiveCfg = Release|x64
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|x64.Build.0 = Release|x64
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|x86.ActiveCfg = Release|x86
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151}.Release|x86.Build.0 = Release|x86
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|x64.ActiveCfg = Debug|x64
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|x64.Build.0 = Debug|x64
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|x86.ActiveCfg = Debug|x86
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Debug|x86.Build.0 = Debug|x86
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|Any CPU.Build.0 = Release|Any CPU
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|x64.ActiveCfg = Release|x64
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|x64.Build.0 = Release|x64
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|x86.ActiveCfg = Release|x86
{CA095DE4-9BC3-49E4-A764-D4406AA4D795}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -526,6 +554,8 @@ Global
{970D21A9-6343-49A1-A8F5-CA87B42D62FF} = {AEE84FD5-7441-42CF-AA6C-5805B759E1F8}
{8B69B142-8E89-4ECB-AB6D-5D6E7A6925F4} = {AF35E6EE-C244-4E1F-84A6-DED8F9BD0EC7}
{F2B18F42-2A58-413A-921F-71648DB0C250} = {AEE84FD5-7441-42CF-AA6C-5805B759E1F8}
{AEDF6FCA-CFF8-47EB-9DF1-D62C776BE151} = {AEE84FD5-7441-42CF-AA6C-5805B759E1F8}
{CA095DE4-9BC3-49E4-A764-D4406AA4D795} = {29411031-4490-4542-B2D1-02D223BFD605}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C4990EC-248E-49D5-A254-EA8AD214C338}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The first command presents four frames and exits. The second verifies GPU comput
| `DXSharp.Assets` | Static glTF/GLB models, materials, transforms, and decoded textures |
| `DXSharp.Core` | D3D12, DXGI, DXC, and generated COM interop |
| `DXSharp.Framework.Desktop` | WinForms presentation loop, swap-chain resize, and frame-slot retirement |
| `DXSharp.Framework.Wpf` | Optional WPF child-HWND viewport using the shared frame renderer; [hosting contract](doc/Wpf-Hosting.md) |
| `DXSharp.DirectML` | Device and operator ownership, tensor binding, and DirectML execution |
| `DXSharp`, `DXSharp.Framework`, `DXSharp.Dxc` | Compatibility packages for the original RCW-based SDK |

Expand Down
15 changes: 13 additions & 2 deletions build/VerifyPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@ try {
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($version)) {
throw 'Unable to evaluate the package version.'
}
foreach ($name in @('DXSharp', 'DXSharp.Dxc', 'DXSharp.Framework', 'DXSharp.Framework.Desktop', 'DXSharp.Native', 'DXSharp.Assets', 'DXSharp.Core', 'DXSharp.DirectML')) {
foreach ($name in @('DXSharp', 'DXSharp.Dxc', 'DXSharp.Framework', 'DXSharp.Framework.Desktop', 'DXSharp.Framework.Wpf', 'DXSharp.Native', 'DXSharp.Assets', 'DXSharp.Core', 'DXSharp.DirectML')) {
$path = Join-Path $packageDirectory "$name.$version.nupkg"
if (-not (Test-Path $path)) { throw "Missing package: $path" }
$archive = [System.IO.Compression.ZipFile]::OpenRead($path)
try {
$reader = [System.IO.StreamReader]::new($archive.GetEntry("$name.nuspec").Open())
try { [xml] $metadata = $reader.ReadToEnd() } finally { $reader.Dispose() }
$frameworkReferences = @($metadata.SelectNodes("//*[local-name()='frameworkReference']") | ForEach-Object { $_.GetAttribute('name') })
if ($name -eq 'DXSharp.Framework.Wpf' -and
('Microsoft.WindowsDesktop.App.WPF' -notin $frameworkReferences -or 'Microsoft.WindowsDesktop.App.WindowsForms' -in $frameworkReferences)) {
throw 'The WPF package must declare WPF without acquiring Windows Forms.'
}
if ($name -in @('DXSharp.Native', 'DXSharp.Core', 'DXSharp.Framework', 'DXSharp.Assets') -and
@($frameworkReferences | Where-Object { $_ -like 'Microsoft.WindowsDesktop*' }).Count -gt 0) {
throw "Optional desktop framework leaked into $name."
}
$assemblies = @($archive.Entries | Where-Object FullName -CLike "lib/*/$name.dll")
if ($assemblies.Count -eq 0) { throw "No library assembly found in $path" }
if ($name -in @('DXSharp.Native', 'DXSharp.Core', 'DXSharp.DirectML', 'DXSharp.Framework.Desktop', 'DXSharp.Assets', 'DXSharp.Framework')) {
if ($name -in @('DXSharp.Native', 'DXSharp.Core', 'DXSharp.DirectML', 'DXSharp.Framework.Desktop', 'DXSharp.Framework.Wpf', 'DXSharp.Assets', 'DXSharp.Framework')) {
foreach ($major in '10', '11') {
# NuGet normalizes the trailing zero of the Windows platform version.
$framework = if ($name -eq 'DXSharp.Assets') { "net$major.0" } else { "net$major.0-windows10.0.26100" }
Expand Down
2 changes: 2 additions & 0 deletions build/VerifySamples.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ try {
}

Invoke-Sample 'CharacterLab-native' @('run', '--project', 'samples/CharacterLab.Native', '-c', 'Debug', '--', '--warp', '--frames=9', '--resize-test')
Invoke-Sample 'CharacterLab-wpf' @('run', '--project', 'samples/CharacterLab.Wpf', '-c', 'Debug', '--', '--warp', '--frames=9')
Invoke-Sample 'CharacterLab-wpf-host' @('run', '--project', 'samples/CharacterLab.Wpf', '-c', 'Debug', '--', '--warp', '--host-test')
Invoke-Sample 'DepthStencil' @('run', '--project', 'samples/DepthStencil', '-c', 'Debug', '--', '--warp')

Invoke-Sample 'ModernTriangle' @('run', '--project', 'samples/ModernTriangle', '-c', 'Debug', '--',
Expand Down
2 changes: 1 addition & 1 deletion build/release_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import xml.etree.ElementTree as ET
from zipfile import ZipFile

PACKAGE_IDS = ("DXSharp.Native", "DXSharp.Assets", "DXSharp.Core", "DXSharp.DirectML", "DXSharp.Framework.Desktop", "DXSharp.Framework", "DXSharp.Tools.Builds")
PACKAGE_IDS = ("DXSharp.Native", "DXSharp.Assets", "DXSharp.Core", "DXSharp.DirectML", "DXSharp.Framework", "DXSharp.Framework.Desktop", "DXSharp.Framework.Wpf", "DXSharp.Tools.Builds")
PREVIEW = re.compile(r"(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)-(?:net10-)?preview\.[1-9][0-9]*")


Expand Down
8 changes: 7 additions & 1 deletion build/verify_sample_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tempfile
import xml.etree.ElementTree as ET

SDK_PACKAGES = ("DXSharp.Native", "DXSharp.Core", "DXSharp.DirectML", "DXSharp.Framework.Desktop", "DXSharp.Assets", "DXSharp.Framework")
SDK_PACKAGES = ("DXSharp.Native", "DXSharp.Core", "DXSharp.DirectML", "DXSharp.Framework.Desktop", "DXSharp.Framework.Wpf", "DXSharp.Assets", "DXSharp.Framework")
EXCLUDED = {"bin", "obj", "artifacts", ".vs"}


Expand Down Expand Up @@ -117,6 +117,12 @@ def qualify(configuration, runtime_major):
if path.exists():
raise RuntimeError(f'Native precompiled consumer deployed {name}')
run([str(native), "--warp", "--frames=9", "--resize-test"], consumer, evidence / "character-native-runtime.log")
wpf = consumer / "samples/CharacterLab.Wpf/bin" / configuration / framework / "CharacterLab.Wpf.dll"
for name in ('dxcompiler.dll', 'dxil.dll'):
if (wpf.parent / name).exists():
raise RuntimeError(f'WPF precompiled consumer deployed {name}')
run([str(wpf), "--warp", "--frames=9"], consumer, evidence / "character-wpf-runtime.log")
run([str(wpf), "--warp", "--host-test"], consumer, evidence / "character-wpf-host.log")
(evidence / "samples.json").write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
print(f"PASS: all {len(manifest)} runnable samples consume packaged SDK {version} outside the checkout.")

Expand Down
4 changes: 3 additions & 1 deletion doc/Framework-Vision.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ Acceptance remains workload-based: CPU/GPU deformation agreement; clear allocati

## Shader and host continuation

The next working slice adds precompiled Framework shader resources, typed runtime compiler options and a packaged incremental DXC task. FrameRenderer now separates frame slots/presentation from UI scheduling; DesktopGame keeps its API and NativeGame supplies an independent Win32 host. CharacterLab.Native shares the existing scene and has no WinForms reference. See [the shader/host contract](Shader-Build-and-Hosting.md) for packaging, cross-compilation limits and qualification. WinUI/WPF adapters and the full application lifecycle remain continuation work.
The shader/host slice adds precompiled Framework shader resources, typed runtime compiler options and a packaged incremental DXC task. FrameRenderer separates frame slots/presentation from UI scheduling; DesktopGame keeps its API and NativeGame supplies an independent Win32 host. CharacterLab.Native shares the existing scene and has no WinForms reference. See [the shader/host contract](Shader-Build-and-Hosting.md) for packaging, cross-compilation limits and qualification.

The optional `DXSharp.Framework.Wpf` adapter now hosts the shared CharacterLab scene with dispatcher scheduling, physical-pixel resize and explicit stop/drain ownership. See [WPF hosting](Wpf-Hosting.md). WinUI composition and the full Game/Application lifecycle remain continuation work; WPF/BAML NativeAOT is not inferred from the separate native interop gates.
6 changes: 3 additions & 3 deletions doc/Publishing-Previews.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Publishing DXSharp previews

The first public version is `0.4.0-net10-preview.1`. Preview 2 is `0.4.0-net10-preview.2`; the next candidate is `0.4.0-preview.3`, with .NET 10 and .NET 11 assets. Neutral preview names are accepted alongside the earlier net10-preview versions. Publish `DXSharp.Native`, `DXSharp.Assets`, `DXSharp.Core`, `DXSharp.DirectML`, and `DXSharp.Framework.Desktop` for Windows x64. The legacy projects continue to build and produce CI artifacts for migration. The public preview depends only on the modern packages and their pinned upstream native dependencies.
Preview 3 shipped five modern package IDs. Preview 4 development adds Framework, the DXC build tool and the optional WPF host. The candidate set is defined in `build/release_packages.py`: `DXSharp.Native`, `DXSharp.Assets`, `DXSharp.Core`, `DXSharp.DirectML`, `DXSharp.Framework.Desktop`, `DXSharp.Framework`, `DXSharp.Framework.Wpf` and `DXSharp.Tools.Builds`. Library assets target .NET 10/11 for Windows x64 (Assets is portable; the build tool targets netstandard2.0). Legacy compatibility projects remain independently buildable CI artifacts. Published versions remain immutable.

## One-time configuration

1. In GitHub, create the `nuget` environment and restrict deployments to `main`. Enable a required reviewer if supported by the repository plan. Set the environment secret `NUGET_USER` to the nuget.org profile name of the publishing account.
2. On nuget.org, create a [Trusted Publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing) policy owned by the account or organization that will own the packages. Set repository owner `atcarter714`, repository `DXSharp`, workflow filename `release.yml`, and environment `nuget`. Enable creation and updates for the five package IDs above. The first publish requires creation scope. Disable it once all five IDs have owners and versions on the feed.
2. On nuget.org, create a [Trusted Publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing) policy owned by the account or organization that will own the packages. Set repository owner `atcarter714`, repository `DXSharp`, workflow filename `release.yml`, and environment `nuget`. Enable creation and updates for the candidate package IDs above. The first publish requires creation scope. Disable it once all candidate IDs have owners and versions on the feed.
3. In Azure DevOps, keep `devops/azure-pipelines.yml` configured as the build definition and use build validation on the integration branch. The Azure Release build retains an independently qualified candidate artifact. GitHub Actions holds the public publishing identity. [Azure build and retention](../devops/readme.md)

## Release

1. Prepare the intended `PackageVersion` in `Directory.Build.props` and its matching `doc/releases/<version>.md` notes. Review the [qualification checklist](SDK-Release-Qualification.md) and attach hardware logs to the release review.
2. A merge to `main` that changes a versioned release note starts **DXSharp preview release** automatically. The workflow qualifies the exact triggering commit with Release builds, package consumption, WARP, and Windows and Linux NativeAOT.
3. After qualification, it publishes a GitHub prerelease at that commit and attaches the five packages, symbols, and a SHA-256 manifest. The separate NuGet job verifies the downloaded candidate, tag commit, and package version availability, then requests a temporary NuGet credential. It pushes Native, then Core, and then its dependents. The release notes distinguish the GitHub assets from NuGet publication and record the publishing run after successful upload.
3. After qualification, it publishes a GitHub prerelease at that commit and attaches the qualified package set, symbols, and a SHA-256 manifest. The separate NuGet job verifies the downloaded candidate, tag commit, and package version availability, then requests a temporary NuGet credential. It pushes Native, then Core, and then its dependents. The release notes distinguish the GitHub assets from NuGet publication and record the publishing run after successful upload.
4. Verify each package and version in nuget.org and verify the release tag and manifest against the qualifying run. Use a clean consumer with NuGet.org as the only package source to confirm public restore.

For a manual dry run before merging, dispatch the workflow with the exact committed version and **publish** unchecked. A manual publishing run is restricted to `main`. Keep the release tag bound to the manifest's commit.
Expand Down
1 change: 1 addition & 0 deletions doc/SDK-Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ flowchart TD
| `DXSharp.Core` | Device and queue ownership, buffers and resource states, descriptors, pipelines, HWND swap chains, DXC, and a bounded DXR surface |
| `DXSharp.DirectML` | Same-device tensor binding and synchronous compiled Add and GEMM execution with optional fused ReLU |
| `DXSharp.Framework.Desktop` | A WinForms-owned STA loop, one or two fenced frame slots, resize, depth target, and presentation |
| `DXSharp.Framework.Wpf` | Optional WPF dispatcher scheduling and a child-HWND viewport over the shared frame renderer |
| `DXSharp`, `DXSharp.Dxc`, `DXSharp.Framework` | Compatibility types, RCWs, older wrappers and framework. The compatibility tests still exercise this path. BasicSample uses the current desktop host. |

### Release documentation
Expand Down
2 changes: 1 addition & 1 deletion doc/Sample-Showcase-Plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Keep Core and Framework independent of WPF and Windows App SDK dependencies. Eac
| --- | --- | --- |
| Native Win32 | Existing DXSharp.Framework | NativeGame and HWND FrameRenderer; no Windows Forms dependency |
| Windows Forms | Existing DXSharp.Framework.Desktop | Existing DesktopGame adapter |
| WPF | Proposed DXSharp.Framework.Wpf | HwndHost child HWND using the existing frame renderer; WPF dispatcher owns scheduling and teardown |
| WPF | DXSharp.Framework.Wpf | D3D12Viewport child HWND and shared CharacterLab.Wpf scene; dispatcher scheduling and fenced teardown; see [contract](Wpf-Hosting.md) |
| WinUI 3 | Proposed DXSharp.Framework.WinUI | Composition swap chain attached through Microsoft.UI.Xaml ISwapChainPanelNative; Windows App SDK dependency stays in this adapter |

WPF's child HWND has airspace restrictions: WPF elements cannot freely overlap or transform it as ordinary composed content. D3DImage is a different path requiring a Direct3D9 surface bridge and synchronization; it is not a direct D3D12 swap-chain target. Start with an honest HwndHost sample and assess a composed surface bridge separately if editor overlays require it.
Expand Down
Loading
Loading