From fc9e77e8027ba0de4951bad49aa6a6744865c9ed Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Fri, 9 Oct 2026 10:25:04 +0800 Subject: [PATCH 01/16] Prepare release notes for v0.1.0-preview.23 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 279 ++++++++++++++++++----------------- eng/release/UNRELEASED.md | 20 +-- 2 files changed, 150 insertions(+), 149 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index fa119f79..9a85b1b3 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -1,9 +1,10 @@ -## Prerelease v0.1.0-preview.22 +## Prerelease v0.1.0-preview.23 -This preview adds standalone WinRT interface implementations, improves Python -asyncio and Classic COM support, and introduces experimental flat Win32 bindings. -It also includes projection, collection, ownership, and native-boundary fixes -since preview.21. +This preview improves Python apartment lifetime safety, Object value conversion, +callback projection, overload dispatch, and type declarations. It also fixes +generated JavaScript/TypeScript interface inputs and async-with-progress +Promises, and adds Windows Python output-path diagnostics. These changes are +relative to preview.22. ## Packages and requirements @@ -12,140 +13,152 @@ since preview.21. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 -or later; the Python runtime and generated bindings require CPython 3.11-3.14. -Available APIs also depend on the installed Windows version, SDK components, -package identity, and hardware. +The npm version and release tag use `0.1.0-preview.23`; Python packages use the +equivalent PEP 440 version `0.1.0rc23`. Runtime packages target Windows x64 and +ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated +bindings require CPython 3.11-3.14. The standalone Python codegen supports +Python 3.8-3.14. Available APIs also depend on Windows components, metadata, +package identity, framework bootstrap, and hardware. ```powershell -npm install @microsoft/dynwinrt -npm install -D @microsoft/dynwinrt-codegen -python -m pip install --pre dynwinrt dynwinrt-codegen +npm install @microsoft/dynwinrt@0.1.0-preview.23 +npm install -D @microsoft/dynwinrt-codegen@0.1.0-preview.23 +python -m pip install --pre "dynwinrt==0.1.0rc23" "dynwinrt-codegen==0.1.0rc23" ``` ## Highlights -### WinRT interface implementations - -Implement supported WinRT interfaces in JavaScript or Python with -`.implement(...)` and `.implementation(...)`. Synchronous, owner-thread handlers -support methods, properties, events, supported structs/arrays, and named multiple -outputs, with typed interface views, multi-interface composition, and explicit -release/disposal. This does not register an OS class or create a COM server. -See the supported contracts and lifetime rules in the -[interface implementation guide](https://github.com/microsoft/dynwinrt/blob/main/docs/guides/windows/winrt-interface-implementations.md). - -### Python asyncio and value conversion - -- Use generated operations with `asyncio.create_task()` and `TaskGroup`, retaining - cancellation and progress. Task scheduling is one-shot; direct awaits remain repeatable. -- Copy between `IBuffer` and JavaScript `Buffer`/`Uint8Array` or Python `bytes`/`bytearray`. -- Explicitly unbox supported `IPropertyValue` scalars and arrays with - `unboxObject()` / `unbox_object()`; generated `Object` results remain unchanged. - -### Expanded Classic COM projections - -- Expand contract-validated JS/TS projections, including HGLOBAL transfer and - variable-length audio formats. -- Add non-consuming `projectAs(...)` interface views, bounded typed activation, - and native completion-to-Promise support for `ActivateAudioInterfaceAsync`. -- Add bounded copy helpers for supported audio, WIC, and linear Media Foundation operations. -- Generate canonical namespace output under `generated/com/`, with separate - unsafe companions and `@microsoft/dynwinrt/com/unsafe/raw`. -- Give previously ambiguous ordinary overloads explicit slot-qualified names - and centralize metadata, ownership, and cleanup contract evidence. - -Safe support remains contract-specific; unsafe entrypoints retain caller-owned -ABI, ownership, and lifetime obligations. - -### Experimental flat Win32 bindings - -Generate JS/TS bindings for a validated subset of DLL exports through -`@microsoft/dynwinrt/win32`, with CJS/ESM namespace modules, status and `LastError` -handling, managed resource cleanup, and explicit Winsock, GDI+, and Media -Foundation contexts. File I/O includes cancellable IOCP-backed -`ReadFile`/`WriteFile` Promises with bounded buffers. Support is partial and does -not yet provide a backward-compatibility guarantee. See the -[Win32 support guide](https://github.com/microsoft/dynwinrt/blob/main/docs/architecture/flat-win32-contracts.md). - -## Correctness and reliability - -- Preserve signed and unsigned WinRT enum backing types in signatures, generic - IIDs, and value conversion, including high-bit constants, arrays, struct - fields, boxed references, and callbacks. -- Normalize signed 32-bit patterns from JavaScript bitwise operations for - generated WinRT and Classic COM UInt32 flags inputs, without relaxing - ordinary UInt32 validation. -- Reject mismatched native-wrapper types in JavaScript calls, including nested - collection inputs and callback results. -- Fix WinRT collection bulk-operation element strides and reject unsupported - collection layouts or ownership shapes before native use. -- Accept explicit `null` for generated JavaScript WinRT collection inputs; - omitted or `undefined` arguments do not silently become null. -- Fix JavaScript collection factories and automatic `IReference` element - boxing, including native array parameters. Convert JavaScript `Map` inputs - to independently owned `IMapView` snapshots through the native `GetView` operation. -- Make duplicate map-constructor keys follow `Insert`: the last value wins, - while the first key and its iteration position are retained. Compare admitted - struct elements and keys by their fields rather than padding, using numerical - floating-point equality. -- Register WinRT interfaces by IID rather than short name, avoiding collisions - between independently generated packages. -- Fix ownership cycles in runtime metadata registration. -- Preserve Win32 resource ownership when explicit cleanup fails, allowing cleanup - to be retried. -- Fix TypeScript union-element array declarations and align nullable collection - output types with runtime values. -- Fix generated COM identifier escaping and architecture-specific aggregate keys. -- Fix Python annotation and helper-name collisions, including standalone nested - struct defaults, and distinguish closed generic interfaces by complete - semantic identity. Improve instance/interface input typing and preserve - subclass types in projected factories. -- Return Python `Char16[]` values as characters, matching their `list[str]` - declarations. Code that relied on integer elements can use `ord()` explicitly. -- Enforce Python projection-scope thread affinity and improve WinUI teardown - through explicit process-level module ownership. Activated WinUI implementation - modules remain loaded until process exit; in-process hot replacement is not supported. -- Resolve CoreMessaging for DispatcherQueue creation and GDI/USER32 helpers - lazily, avoiding their unconditional direct production DLL dependencies. +### Python apartment and native-owner safety + +- Release library-owned raw values, generated wrappers, and COM-bearing arrays + and structs before the final library-managed apartment close, including + independently owned nested and cloned values. This protects ordinary + `RoApartment` exits even without `projected_lifetime_scope()`. Retained Python + owners report that they are released and reject further native access; + scalar-only values and containers remain usable. +- Reject a final apartment close inside a synchronous native-to-Python callback + before owner cleanup or `RoUninitialize`. Named guards remain active for + retry after both the callback and outer native call return. +- Preserve successful nested and manual initialization counts, including + `S_FALSE` and new initializations acquired by Python finalizers during owner + cleanup. A close consumes only its own initialization. Failed cleanup retains + that lease for retry without discarding newly acquired leases. +- Reject explicit apartment operations on the wrong OS thread without changing + state. An implicit foreign-thread guard drop retains an owner-thread + recovery token and emits a native diagnostic instead of calling COM there. +- Keep unsafe pending async owners from being released by apartment cleanup. + Settle or explicitly cancel blocked work before retrying close; cleanup does + not silently cancel it or consume externally owned COM aliases. + +Use `RoApartment.recover_pending()` on the owner thread for a guard deferred +during a callback or dropped on another thread. For an unnamed guard whose +owner cleanup failed, use `retry_pending_apartment_close()` or recover and +explicitly close it after fixing the failure. The retry helper does not consume +a callback-deferred lease. + +### Explicit Python Object values + +- Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated + `Object`/`IInspectable` positions remain native by default; they do not + implicitly box arbitrary Python values. +- Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, + and recursively unboxed InspectableArray values. `preserve_type=True`, + numeric tags, typed arrays, and `PropertyType` retain exact WinRT type + information through `dynwinrt.values`. +- Add the opt-in live `dynwinrt.values.object_value_view()` for supported + `IMap`/`IMapView` projections. Reads unbox and writes + box explicitly; `.raw` retains access to the native map. + +### Python projection contracts + +- Project supported delegate callback arguments from their actual `Invoke` + signatures, including typed `MapChanged` senders and event arguments. +- Unify method names, overloads, aliases, and collision handling across `.py` + and `.pyi`. Preserve existing explicit ABI aliases and successful native + dispatch targets, and use QueryInterface for compatible interface-typed + overload inputs rather than requiring a particular wrapper class. +- Type `.pyi` outputs as non-null by default while preserving supported nullable + positions, including `IReference`, `Try*` results, Object/delegate values, + documented Windows SDK null results, and reference collection elements. + Correct exact XML DOM declarations for absent roots, DTDs, node navigation, + owner documents, and attribute lookup/replacement results. Runtime null + conversion and the broader inline `.py` output annotations are unchanged. +- Reject native null before mutating stock `JsonArray`/`JsonObject`, including + bulk writes and generic interface views. Rejected null input leaves the + collection unchanged; custom generic collections retain their valid + native-null behavior. +- QueryInterface-check direct generated interface construction before retaining + a pointer. Validate array element contracts before taking independent native + references, and reject Async receivers in low-level `call_0()`/`call_1()` + before vtable dispatch. +- Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and + `RO_INIT_MULTITHREADED` constants. + +### JavaScript/TypeScript and shared code generation + +- Reuse the existing projected Promise from generated async-with-progress + `.toPromise()`. Repeated calls no longer register native completion twice; + direct await and `.toPromise()` share the converted result or rejection. + Pre-aborted signals also reuse their existing rejected Promise. +- Retain explicit interface-method aliases as real JavaScript class methods + with matching declarations. For example, `StorageFile` can satisfy + `IStorageFile` inputs in strict TypeScript while keeping `copyAsync(...)` + and adding the interface's `copyOverloadDefaultOptions(...)` alias. Existing + overload dispatchers and `.as(...)` views remain supported. +- Classify explicitly selected non-generic WinRT delegates correctly in both + JavaScript and Python. Delegate-only, combined class/delegate, namespace, and + incremental selections reuse the existing automatic-dependency projection; + malformed or open-generic delegate roots fail explicitly. +- Warn before publishing generated Python output when a final `.py`/`.pyi` + path reaches the legacy Windows 260-UTF-16-unit boundary. The diagnostic + identifies the longest final path and how much shorter the output root must + be, without changing generated names, layout, or bytes. ## Upgrade notes -Upgrade runtime and codegen together, then regenerate affected bindings. -Regenerate all packages sharing unsigned WinRT enum declarations together; -do not mix old signed declarations with corrected unsigned declarations. - -- **Python:** fully regenerate and rebuild/reinstall all packages exchanging - closed generic interfaces together. Do not mix old and new stubs. Prefer public - namespace exports over hard-coded internal or long generated module paths. - Worker threads need their own `RoApartment` and `projected_lifetime_scope()`. -- **JavaScript/TypeScript collections:** guard nullable collection outputs. - A present `null` differs from the `undefined` returned for a missing map key - or out-of-range `at()` index. Map `get()` now propagates conversion and native - errors; its `HasKey`/`Lookup` sequence is not atomic against native mutation. -- **Low-level JavaScript UInt32 inputs:** factories, array constructors, and fast - setters reject negative, fractional, non-finite, and out-of-range values - instead of silently wrapping them. Generated UInt32 flags projections handle - ordinary JavaScript bitwise combinations. -- **Classic COM (JS/TS):** regenerate all selected roots into a fresh output directory - and update imports for the namespace layout. -- **Node.js / Electron:** use runtime entrypoints from the same installed package; - do not mix native objects from different builds. - -## Samples and notes - -New and updated samples cover standalone interface implementations, XAML and -code-only WinUI apps, OCR, asynchronous file I/O, Aion Electron chat, and flat -Win32 system/registry/file operations. Setup guidance adopts WinApp CLI and -clarifies metadata, packaging, Windows component, and hardware prerequisites. -See each sample's README before running it. - -Build and release workflows gain parallel validation, expanded projection and -native-boundary regression coverage, and file-based release notes. Native -dependency inspection no longer requires Visual Studio. Guides, JavaScript -binding internals, and benchmark dependencies are also updated. - -Classic COM, flat Win32, and WinUI hosting remain experimental. - -For installation and usage, see the -[README](https://github.com/microsoft/dynwinrt#readme). +Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstall +affected bindings. Generated Python manifests pin the matching runtime version; +do not mix old generated packages or stubs with a different runtime. + +- **Python lifecycle:** initialize and balance each worker thread's own + apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup + tool; do not rely on garbage collection to close apartments or on a close to + revoke external COM references. +- **Python typing:** regenerate `.pyi` files together with their runtime + modules. Cache potentially absent results and guard them before reading + members. The Windows SDK nullable-result facts are not a universal + nullability guarantee for custom or Windows App SDK metadata. +- **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. + It is a non-null native `IJsonValue`; Python `None` is not a substitute in + stock JSON collections. +- **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit + tags or `PropertyType` for other widths, enums, empty/mixed arrays, and + InspectableArray. Re-boxing preserves type and value, not box identity. +- **JavaScript/TypeScript:** regenerate wrappers to obtain interface aliases + and the progress Promise fix; upgrading the native runtime alone does not + repair previously generated JavaScript. +- **Rust source compatibility:** exhaustive matches on public + `PropertyValueData` and `PropertyValueUnboxResult` must handle the new payload + variants and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Keep + `Null` and `NotPropertyValue` distinct and handle unsupported boxes explicitly. + +## Known boundaries + +Classic COM, flat Win32, and WinUI hosting remain experimental. This preview does +not expand their support guarantees or remove the documented architecture-specific +WinRT collection-producer limits. Native ARM64 live WinUI coverage remains +incomplete; ordinary runtime-wheel checks do not establish full UI support. + +Embedded hosts retaining native aliases to Python-backed callbacks must stop new +calls, settle in-flight callbacks, and call `shutdown_python_callbacks()` while +Python is alive, before `Py_FinalizeEx`. Hosts skipping that protocol have only +best-effort protection against callbacks during early interpreter finalization; +no universal deadlock-free guarantee is claimed. + +Python path warnings are diagnostic only. Use short output and venv paths, +leaving headroom for pip staging and installation. No warning is not a guarantee +that every downstream tool can open arbitrary long paths. + +For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), +[Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), +and the [project README](https://github.com/microsoft/dynwinrt#readme). diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 42b5f89e..7851c962 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -1,18 +1,6 @@ ## Unreleased (next preview) -Draft notes for a future release, not part of v0.1.0-preview.22. Before tagging -the next release, promote the applicable entries to `RELEASE_NOTES.md` under -the correct version heading. The release pipeline does not stage this file. - -### Python Object values - -- Explicitly box Python values with `to_winrt_object()` and convert values in - supported Object-valued maps with `dynwinrt.values.object_value_view()`. - Generated `Object` positions remain native by default. - -### Rust source compatibility - -- Exhaustive matches on the public `PropertyValueData` and - `PropertyValueUnboxResult` enums must add arms for the new payload variants - and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Handle unsupported - boxes explicitly; keep `Null` and `NotPropertyValue` distinct. +No pending entries. Add draft notes here for changes after the +v0.1.0-preview.23 release preparation. Before a later release, promote applicable +entries to `RELEASE_NOTES.md` under the correct version heading. The release +pipeline does not stage this file. From b5a8c76eb381586580155ab90b2818adf82a2ad0 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Fri, 9 Oct 2026 11:08:51 +0800 Subject: [PATCH 02/16] Keep release-note paragraphs on single source lines Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 159 ++++++++--------------------------- 1 file changed, 34 insertions(+), 125 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 9a85b1b3..b1125d78 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -1,10 +1,6 @@ ## Prerelease v0.1.0-preview.23 -This preview improves Python apartment lifetime safety, Object value conversion, -callback projection, overload dispatch, and type declarations. It also fixes -generated JavaScript/TypeScript interface inputs and async-with-progress -Promises, and adds Windows Python output-path diagnostics. These changes are -relative to preview.22. +This preview improves Python apartment lifetime safety, Object value conversion, callback projection, overload dispatch, and type declarations. It also fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises, and adds Windows Python output-path diagnostics. These changes are relative to preview.22. ## Packages and requirements @@ -13,12 +9,7 @@ relative to preview.22. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -The npm version and release tag use `0.1.0-preview.23`; Python packages use the -equivalent PEP 440 version `0.1.0rc23`. Runtime packages target Windows x64 and -ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated -bindings require CPython 3.11-3.14. The standalone Python codegen supports -Python 3.8-3.14. Available APIs also depend on Windows components, metadata, -package identity, framework bootstrap, and hardware. +The npm version and release tag use `0.1.0-preview.23`; Python packages use the equivalent PEP 440 version `0.1.0rc23`. Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. The standalone Python codegen supports Python 3.8-3.14. Available APIs also depend on Windows components, metadata, package identity, framework bootstrap, and hardware. ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 @@ -30,135 +21,53 @@ python -m pip install --pre "dynwinrt==0.1.0rc23" "dynwinrt-codegen==0.1.0rc23" ### Python apartment and native-owner safety -- Release library-owned raw values, generated wrappers, and COM-bearing arrays - and structs before the final library-managed apartment close, including - independently owned nested and cloned values. This protects ordinary - `RoApartment` exits even without `projected_lifetime_scope()`. Retained Python - owners report that they are released and reject further native access; - scalar-only values and containers remain usable. -- Reject a final apartment close inside a synchronous native-to-Python callback - before owner cleanup or `RoUninitialize`. Named guards remain active for - retry after both the callback and outer native call return. -- Preserve successful nested and manual initialization counts, including - `S_FALSE` and new initializations acquired by Python finalizers during owner - cleanup. A close consumes only its own initialization. Failed cleanup retains - that lease for retry without discarding newly acquired leases. -- Reject explicit apartment operations on the wrong OS thread without changing - state. An implicit foreign-thread guard drop retains an owner-thread - recovery token and emits a native diagnostic instead of calling COM there. -- Keep unsafe pending async owners from being released by apartment cleanup. - Settle or explicitly cancel blocked work before retrying close; cleanup does - not silently cancel it or consume externally owned COM aliases. - -Use `RoApartment.recover_pending()` on the owner thread for a guard deferred -during a callback or dropped on another thread. For an unnamed guard whose -owner cleanup failed, use `retry_pending_apartment_close()` or recover and -explicitly close it after fixing the failure. The retry helper does not consume -a callback-deferred lease. +- Release library-owned raw values, generated wrappers, and COM-bearing arrays and structs before the final library-managed apartment close, including independently owned nested and cloned values. This protects ordinary `RoApartment` exits even without `projected_lifetime_scope()`. Retained Python owners report that they are released and reject further native access; scalar-only values and containers remain usable. +- Reject a final apartment close inside a synchronous native-to-Python callback before owner cleanup or `RoUninitialize`. Named guards remain active for retry after both the callback and outer native call return. +- Preserve successful nested and manual initialization counts, including `S_FALSE` and new initializations acquired by Python finalizers during owner cleanup. A close consumes only its own initialization. Failed cleanup retains that lease for retry without discarding newly acquired leases. +- Reject explicit apartment operations on the wrong OS thread without changing state. An implicit foreign-thread guard drop retains an owner-thread recovery token and emits a native diagnostic instead of calling COM there. +- Keep unsafe pending async owners from being released by apartment cleanup. Settle or explicitly cancel blocked work before retrying close; cleanup does not silently cancel it or consume externally owned COM aliases. + +Use `RoApartment.recover_pending()` on the owner thread for a guard deferred during a callback or dropped on another thread. For an unnamed guard whose owner cleanup failed, use `retry_pending_apartment_close()` or recover and explicitly close it after fixing the failure. The retry helper does not consume a callback-deferred lease. ### Explicit Python Object values -- Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated - `Object`/`IInspectable` positions remain native by default; they do not - implicitly box arbitrary Python values. -- Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, - and recursively unboxed InspectableArray values. `preserve_type=True`, - numeric tags, typed arrays, and `PropertyType` retain exact WinRT type - information through `dynwinrt.values`. -- Add the opt-in live `dynwinrt.values.object_value_view()` for supported - `IMap`/`IMapView` projections. Reads unbox and writes - box explicitly; `.raw` retains access to the native map. +- Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated `Object`/`IInspectable` positions remain native by default; they do not implicitly box arbitrary Python values. +- Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, and recursively unboxed InspectableArray values. `preserve_type=True`, numeric tags, typed arrays, and `PropertyType` retain exact WinRT type information through `dynwinrt.values`. +- Add the opt-in live `dynwinrt.values.object_value_view()` for supported `IMap`/`IMapView` projections. Reads unbox and writes box explicitly; `.raw` retains access to the native map. ### Python projection contracts -- Project supported delegate callback arguments from their actual `Invoke` - signatures, including typed `MapChanged` senders and event arguments. -- Unify method names, overloads, aliases, and collision handling across `.py` - and `.pyi`. Preserve existing explicit ABI aliases and successful native - dispatch targets, and use QueryInterface for compatible interface-typed - overload inputs rather than requiring a particular wrapper class. -- Type `.pyi` outputs as non-null by default while preserving supported nullable - positions, including `IReference`, `Try*` results, Object/delegate values, - documented Windows SDK null results, and reference collection elements. - Correct exact XML DOM declarations for absent roots, DTDs, node navigation, - owner documents, and attribute lookup/replacement results. Runtime null - conversion and the broader inline `.py` output annotations are unchanged. -- Reject native null before mutating stock `JsonArray`/`JsonObject`, including - bulk writes and generic interface views. Rejected null input leaves the - collection unchanged; custom generic collections retain their valid - native-null behavior. -- QueryInterface-check direct generated interface construction before retaining - a pointer. Validate array element contracts before taking independent native - references, and reject Async receivers in low-level `call_0()`/`call_1()` - before vtable dispatch. -- Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and - `RO_INIT_MULTITHREADED` constants. +- Project supported delegate callback arguments from their actual `Invoke` signatures, including typed `MapChanged` senders and event arguments. +- Unify method names, overloads, aliases, and collision handling across `.py` and `.pyi`. Preserve existing explicit ABI aliases and successful native dispatch targets, and use QueryInterface for compatible interface-typed overload inputs rather than requiring a particular wrapper class. +- Type `.pyi` outputs as non-null by default while preserving supported nullable positions, including `IReference`, `Try*` results, Object/delegate values, documented Windows SDK null results, and reference collection elements. Correct exact XML DOM declarations for absent roots, DTDs, node navigation, owner documents, and attribute lookup/replacement results. Runtime null conversion and the broader inline `.py` output annotations are unchanged. +- Reject native null before mutating stock `JsonArray`/`JsonObject`, including bulk writes and generic interface views. Rejected null input leaves the collection unchanged; custom generic collections retain their valid native-null behavior. +- QueryInterface-check direct generated interface construction before retaining a pointer. Validate array element contracts before taking independent native references, and reject Async receivers in low-level `call_0()`/`call_1()` before vtable dispatch. +- Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and `RO_INIT_MULTITHREADED` constants. ### JavaScript/TypeScript and shared code generation -- Reuse the existing projected Promise from generated async-with-progress - `.toPromise()`. Repeated calls no longer register native completion twice; - direct await and `.toPromise()` share the converted result or rejection. - Pre-aborted signals also reuse their existing rejected Promise. -- Retain explicit interface-method aliases as real JavaScript class methods - with matching declarations. For example, `StorageFile` can satisfy - `IStorageFile` inputs in strict TypeScript while keeping `copyAsync(...)` - and adding the interface's `copyOverloadDefaultOptions(...)` alias. Existing - overload dispatchers and `.as(...)` views remain supported. -- Classify explicitly selected non-generic WinRT delegates correctly in both - JavaScript and Python. Delegate-only, combined class/delegate, namespace, and - incremental selections reuse the existing automatic-dependency projection; - malformed or open-generic delegate roots fail explicitly. -- Warn before publishing generated Python output when a final `.py`/`.pyi` - path reaches the legacy Windows 260-UTF-16-unit boundary. The diagnostic - identifies the longest final path and how much shorter the output root must - be, without changing generated names, layout, or bytes. +- Reuse the existing projected Promise from generated async-with-progress `.toPromise()`. Repeated calls no longer register native completion twice; direct await and `.toPromise()` share the converted result or rejection. Pre-aborted signals also reuse their existing rejected Promise. +- Retain explicit interface-method aliases as real JavaScript class methods with matching declarations. For example, `StorageFile` can satisfy `IStorageFile` inputs in strict TypeScript while keeping `copyAsync(...)` and adding the interface's `copyOverloadDefaultOptions(...)` alias. Existing overload dispatchers and `.as(...)` views remain supported. +- Classify explicitly selected non-generic WinRT delegates correctly in both JavaScript and Python. Delegate-only, combined class/delegate, namespace, and incremental selections reuse the existing automatic-dependency projection; malformed or open-generic delegate roots fail explicitly. +- Warn before publishing generated Python output when a final `.py`/`.pyi` path reaches the legacy Windows 260-UTF-16-unit boundary. The diagnostic identifies the longest final path and how much shorter the output root must be, without changing generated names, layout, or bytes. ## Upgrade notes -Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstall -affected bindings. Generated Python manifests pin the matching runtime version; -do not mix old generated packages or stubs with a different runtime. - -- **Python lifecycle:** initialize and balance each worker thread's own - apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup - tool; do not rely on garbage collection to close apartments or on a close to - revoke external COM references. -- **Python typing:** regenerate `.pyi` files together with their runtime - modules. Cache potentially absent results and guard them before reading - members. The Windows SDK nullable-result facts are not a universal - nullability guarantee for custom or Windows App SDK metadata. -- **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. - It is a non-null native `IJsonValue`; Python `None` is not a substitute in - stock JSON collections. -- **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit - tags or `PropertyType` for other widths, enums, empty/mixed arrays, and - InspectableArray. Re-boxing preserves type and value, not box identity. -- **JavaScript/TypeScript:** regenerate wrappers to obtain interface aliases - and the progress Promise fix; upgrading the native runtime alone does not - repair previously generated JavaScript. -- **Rust source compatibility:** exhaustive matches on public - `PropertyValueData` and `PropertyValueUnboxResult` must handle the new payload - variants and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Keep - `Null` and `NotPropertyValue` distinct and handle unsupported boxes explicitly. +Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstall affected bindings. Generated Python manifests pin the matching runtime version; do not mix old generated packages or stubs with a different runtime. + +- **Python lifecycle:** initialize and balance each worker thread's own apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup tool; do not rely on garbage collection to close apartments or on a close to revoke external COM references. +- **Python typing:** regenerate `.pyi` files together with their runtime modules. Cache potentially absent results and guard them before reading members. The Windows SDK nullable-result facts are not a universal nullability guarantee for custom or Windows App SDK metadata. +- **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. It is a non-null native `IJsonValue`; Python `None` is not a substitute in stock JSON collections. +- **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit tags or `PropertyType` for other widths, enums, empty/mixed arrays, and InspectableArray. Re-boxing preserves type and value, not box identity. +- **JavaScript/TypeScript:** regenerate wrappers to obtain interface aliases and the progress Promise fix; upgrading the native runtime alone does not repair previously generated JavaScript. +- **Rust source compatibility:** exhaustive matches on public `PropertyValueData` and `PropertyValueUnboxResult` must handle the new payload variants and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Keep `Null` and `NotPropertyValue` distinct and handle unsupported boxes explicitly. ## Known boundaries -Classic COM, flat Win32, and WinUI hosting remain experimental. This preview does -not expand their support guarantees or remove the documented architecture-specific -WinRT collection-producer limits. Native ARM64 live WinUI coverage remains -incomplete; ordinary runtime-wheel checks do not establish full UI support. +Classic COM, flat Win32, and WinUI hosting remain experimental. This preview does not expand their support guarantees or remove the documented architecture-specific WinRT collection-producer limits. Native ARM64 live WinUI coverage remains incomplete; ordinary runtime-wheel checks do not establish full UI support. -Embedded hosts retaining native aliases to Python-backed callbacks must stop new -calls, settle in-flight callbacks, and call `shutdown_python_callbacks()` while -Python is alive, before `Py_FinalizeEx`. Hosts skipping that protocol have only -best-effort protection against callbacks during early interpreter finalization; -no universal deadlock-free guarantee is claimed. +Embedded hosts retaining native aliases to Python-backed callbacks must stop new calls, settle in-flight callbacks, and call `shutdown_python_callbacks()` while Python is alive, before `Py_FinalizeEx`. Hosts skipping that protocol have only best-effort protection against callbacks during early interpreter finalization; no universal deadlock-free guarantee is claimed. -Python path warnings are diagnostic only. Use short output and venv paths, -leaving headroom for pip staging and installation. No warning is not a guarantee -that every downstream tool can open arbitrary long paths. +Python path warnings are diagnostic only. Use short output and venv paths, leaving headroom for pip staging and installation. No warning is not a guarantee that every downstream tool can open arbitrary long paths. -For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), -[Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), -and the [project README](https://github.com/microsoft/dynwinrt#readme). +For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), [Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), and the [project README](https://github.com/microsoft/dynwinrt#readme). From 2e658a0e424702137c688435ee7176f3f8cb913f Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Fri, 9 Oct 2026 11:15:09 +0800 Subject: [PATCH 03/16] Focus release package section on installation Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index b1125d78..81111cb1 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -2,15 +2,13 @@ This preview improves Python apartment lifetime safety, Object value conversion, callback projection, overload dispatch, and type declarations. It also fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises, and adds Windows Python output-path diagnostics. These changes are relative to preview.22. -## Packages and requirements +## Packages and installation - `@microsoft/dynwinrt` - JavaScript/TypeScript runtime. - `@microsoft/dynwinrt-codegen` - JavaScript/TypeScript code generator. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -The npm version and release tag use `0.1.0-preview.23`; Python packages use the equivalent PEP 440 version `0.1.0rc23`. Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. The standalone Python codegen supports Python 3.8-3.14. Available APIs also depend on Windows components, metadata, package identity, framework bootstrap, and hardware. - ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 npm install -D @microsoft/dynwinrt-codegen@0.1.0-preview.23 From b904d9c0e2c75d197a73b482facaf8478fba4e9f Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Fri, 9 Oct 2026 11:33:15 +0800 Subject: [PATCH 04/16] Document next-preview candidate priorities Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/UNRELEASED.md | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 7851c962..0a366786 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -1,6 +1,35 @@ ## Unreleased (next preview) -No pending entries. Add draft notes here for changes after the -v0.1.0-preview.23 release preparation. Before a later release, promote applicable -entries to `RELEASE_NOTES.md` under the correct version heading. The release -pipeline does not stage this file. +Candidate directions after the preview.23 baseline: broader checked collection support, JavaScript/Python Object-conversion parity, and smaller generated bindings. These are proposed priorities, not completed features or a commitment to ship every item in the next preview. + +### Checked POD vector inputs + +Review and integrate the proposed [POD vector work (#179)](https://github.com/microsoft/dynwinrt/pull/179) against current main as the first milestone of [struct collection support (#161)](https://github.com/microsoft/dynwinrt/issues/161). This would let generated JavaScript arrays and Python sequences supply more validated WinRT structs, including ARM64 floating-point aggregates and larger or nested POD layouts. Current checked constructors already accept a limited ABI-safe subset; this is an expansion, not support from zero. Keep maps, structs containing owned references, and metadata-free unsafe constructors outside this milestone. + +Acceptance should cover SDK-typed native x64 and ARM64 vector/view/iterator calls, packed bulk buffers, independent snapshots, observable reentrancy, exact type/IID identity, and rejection of unsupported layouts or ownership. Do not equate merging #179 with completing #161. + +### JavaScript/TypeScript Object-value parity + +Bring the explicit Object-conversion facilities added for Python to JavaScript/TypeScript: type-aware boxing, typed unboxing, and an opt-in live view over supported Object-valued maps. Start from the shared core PropertyValue model; JavaScript currently still rejects DateTime, TimeSpan, geometry, InspectableArray, and their applicable array forms even though the core models those payloads. Keep ordinary generated Object results raw and preserve non-PropertyValue object identity. + +Define number/bigint type selection and date/time precision before enabling new conversions. Acceptance should include exact PropertyType round trips, range and precision boundaries, real PropertySet/map operations, strict TypeScript declarations, and unchanged errors for invalid or unsupported input. Avoid implicit conversion or renderer-level type guessing. + +### Smaller generated JavaScript + +Address [duplicated implementation helpers (#182)](https://github.com/microsoft/dynwinrt/issues/182) by emitting common private helpers once per generated package instead of copying them into every implementation-capable interface module. Start with deduplication without removing interface implementation support or its validation checks. + +Rebaseline against preview.23 using pinned metadata and identical generation options. Record generated bytes, file count, and cold-import cost; verify CJS/ESM loading, custom runtime imports, incremental generation, declarations, callback behavior, and import-cycle safety. The older issue's size measurements are evidence of duplication, not a promised reduction for the next package. + +### Reliability work alongside these features + +- **Installed-wheel lifecycle coverage:** Extend the isolated runtime-wheel consumer beyond a scoped MTA Uri. Add representative unscoped STA/MTA cleanup, synchronous callback close/recovery, and owner-drain reinitialization cases using the installed release artifacts on native x64 and ARM64 across the supported CPython matrix. Keep native, emulated, and compile-only evidence distinct. +- **Read-only lifetime diagnostics:** Expose actionable ownership and apartment state, including pending cleanup and active callback/async blockers, so callers can understand why a close is rejected or deferred. Diagnostics must not retain owners after returning, change native reference ownership, cancel work, or perform foreign-thread cleanup. +- **Strict custom-WinMD validation:** Reject invalid GUID attribute component types and ambiguous required default-interface facts with actionable errors. The shared parser still substitutes zero for wrongly typed GUID components and selects the first default interface; harden those decisions with malformed-metadata fixtures while preserving valid SDK output. + +### WinAppSDK follow-up + +Improve bootstrap discovery and repeated initialization: retain explicit path/environment precedence, select only candidates matching the requested version and process architecture, reuse compatible initialization, and report conflicting requests clearly. Initialization currently requires a supplied DLL path; this work should reduce manual setup without silently changing the requested runtime or initializing COM on the caller's behalf. + +Qualify WinUI behavior separately on an interactive native ARM64 runner as well as x64. The existing ARM64 workflow requires a self-hosted desktop and installed framework; adding discovery or obtaining an emulated pass is not evidence that the live UI path is qualified. + +Only promote items to a later release's notes after implementation, integration review, and the relevant native/consumer verification are complete. From 556140b779c0dde05a37a3558262f875850a2e01 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Fri, 9 Oct 2026 12:33:55 +0800 Subject: [PATCH 05/16] Keep next-preview draft concise Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/UNRELEASED.md | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 0a366786..4400f5dc 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -1,35 +1,7 @@ ## Unreleased (next preview) -Candidate directions after the preview.23 baseline: broader checked collection support, JavaScript/Python Object-conversion parity, and smaller generated bindings. These are proposed priorities, not completed features or a commitment to ship every item in the next preview. +Potential improvements for the next preview: -### Checked POD vector inputs - -Review and integrate the proposed [POD vector work (#179)](https://github.com/microsoft/dynwinrt/pull/179) against current main as the first milestone of [struct collection support (#161)](https://github.com/microsoft/dynwinrt/issues/161). This would let generated JavaScript arrays and Python sequences supply more validated WinRT structs, including ARM64 floating-point aggregates and larger or nested POD layouts. Current checked constructors already accept a limited ABI-safe subset; this is an expansion, not support from zero. Keep maps, structs containing owned references, and metadata-free unsafe constructors outside this milestone. - -Acceptance should cover SDK-typed native x64 and ARM64 vector/view/iterator calls, packed bulk buffers, independent snapshots, observable reentrancy, exact type/IID identity, and rejection of unsupported layouts or ownership. Do not equate merging #179 with completing #161. - -### JavaScript/TypeScript Object-value parity - -Bring the explicit Object-conversion facilities added for Python to JavaScript/TypeScript: type-aware boxing, typed unboxing, and an opt-in live view over supported Object-valued maps. Start from the shared core PropertyValue model; JavaScript currently still rejects DateTime, TimeSpan, geometry, InspectableArray, and their applicable array forms even though the core models those payloads. Keep ordinary generated Object results raw and preserve non-PropertyValue object identity. - -Define number/bigint type selection and date/time precision before enabling new conversions. Acceptance should include exact PropertyType round trips, range and precision boundaries, real PropertySet/map operations, strict TypeScript declarations, and unchanged errors for invalid or unsupported input. Avoid implicit conversion or renderer-level type guessing. - -### Smaller generated JavaScript - -Address [duplicated implementation helpers (#182)](https://github.com/microsoft/dynwinrt/issues/182) by emitting common private helpers once per generated package instead of copying them into every implementation-capable interface module. Start with deduplication without removing interface implementation support or its validation checks. - -Rebaseline against preview.23 using pinned metadata and identical generation options. Record generated bytes, file count, and cold-import cost; verify CJS/ESM loading, custom runtime imports, incremental generation, declarations, callback behavior, and import-cycle safety. The older issue's size measurements are evidence of duplication, not a promised reduction for the next package. - -### Reliability work alongside these features - -- **Installed-wheel lifecycle coverage:** Extend the isolated runtime-wheel consumer beyond a scoped MTA Uri. Add representative unscoped STA/MTA cleanup, synchronous callback close/recovery, and owner-drain reinitialization cases using the installed release artifacts on native x64 and ARM64 across the supported CPython matrix. Keep native, emulated, and compile-only evidence distinct. -- **Read-only lifetime diagnostics:** Expose actionable ownership and apartment state, including pending cleanup and active callback/async blockers, so callers can understand why a close is rejected or deferred. Diagnostics must not retain owners after returning, change native reference ownership, cancel work, or perform foreign-thread cleanup. -- **Strict custom-WinMD validation:** Reject invalid GUID attribute component types and ambiguous required default-interface facts with actionable errors. The shared parser still substitutes zero for wrongly typed GUID components and selects the first default interface; harden those decisions with malformed-metadata fixtures while preserving valid SDK output. - -### WinAppSDK follow-up - -Improve bootstrap discovery and repeated initialization: retain explicit path/environment precedence, select only candidates matching the requested version and process architecture, reuse compatible initialization, and report conflicting requests clearly. Initialization currently requires a supplied DLL path; this work should reduce manual setup without silently changing the requested runtime or initializing COM on the caller's behalf. - -Qualify WinUI behavior separately on an interactive native ARM64 runner as well as x64. The existing ARM64 workflow requires a self-hosted desktop and installed framework; adding discovery or obtaining an emulated pass is not evidence that the live UI path is qualified. - -Only promote items to a later release's notes after implementation, integration review, and the relevant native/consumer verification are complete. +- Broader ABI-safe POD vector support for JavaScript and Python ([#161](https://github.com/microsoft/dynwinrt/issues/161), [#179](https://github.com/microsoft/dynwinrt/pull/179)). +- Explicit Object-value conversion helpers for JavaScript/TypeScript, including boxing, typed unboxing, and opt-in map views. +- Smaller generated JavaScript by sharing implementation helpers ([#182](https://github.com/microsoft/dynwinrt/issues/182)). From e597a1918059e3f07d3673117fdc930715575470 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:31:12 +0800 Subject: [PATCH 06/16] Refresh preview.23 notes for merged Python fixes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 81111cb1..e59873be 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -1,6 +1,6 @@ ## Prerelease v0.1.0-preview.23 -This preview improves Python apartment lifetime safety, Object value conversion, callback projection, overload dispatch, and type declarations. It also fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises, and adds Windows Python output-path diagnostics. These changes are relative to preview.22. +This preview improves Python apartment lifetime safety, collection reference comparisons, Object value conversion, and generated-package installation on Windows. It also strengthens Python callback, overload, and typing contracts, and fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises. These changes are relative to preview.22. ## Packages and installation @@ -27,8 +27,10 @@ python -m pip install --pre "dynwinrt==0.1.0rc23" "dynwinrt-codegen==0.1.0rc23" Use `RoApartment.recover_pending()` on the owner thread for a guard deferred during a callback or dropped on another thread. For an unnamed guard whose owner cleanup failed, use `retry_pending_apartment_close()` or recover and explicitly close it after fixing the failure. The retry helper does not consume a callback-deferred lease. -### Explicit Python Object values +### Python collections and Object values +- Compare WinRT references by canonical COM identity in sequence containment, `index()`, `count()`, and `remove()`, mapping equality, and value/item-view membership. Class, interface, and raw views of the same object now match; distinct objects with equal content remain distinct. Ordinary Python value equality and wrapper equality/hashing outside these collection operations are unchanged. +- Preserve mapping entry counts when Python keys alias the same native reference. Raw `Object` collections do not implicitly box or unbox for comparison; `object_value_view()` compares converted Python values normally and remaining native references by COM identity. - Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated `Object`/`IInspectable` positions remain native by default; they do not implicitly box arbitrary Python values. - Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, and recursively unboxed InspectableArray values. `preserve_type=True`, numeric tags, typed arrays, and `PropertyType` retain exact WinRT type information through `dynwinrt.values`. - Add the opt-in live `dynwinrt.values.object_value_view()` for supported `IMap`/`IMapView` projections. Reads unbox and writes box explicitly; `.raw` retains access to the native map. @@ -41,19 +43,26 @@ Use `RoApartment.recover_pending()` on the owner thread for a guard deferred dur - Reject native null before mutating stock `JsonArray`/`JsonObject`, including bulk writes and generic interface views. Rejected null input leaves the collection unchanged; custom generic collections retain their valid native-null behavior. - QueryInterface-check direct generated interface construction before retaining a pointer. Validate array element contracts before taking independent native references, and reject Async receivers in low-level `call_0()`/`call_1()` before vtable dispatch. - Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and `RO_INIT_MULTITHREADED` constants. +- Correct click-handler annotations in both Python Tic-Tac-Toe samples so they work with precise delegate typing, without changing game behavior or lifetime cleanup. + +### Python package generation and Windows paths + +- Fix generated-package source and wheel installation failures under legacy Windows path limits by selectively shortening over-budget module paths with stable type-identity hashes and compacting setuptools build and wheel staging. Public type names and namespace exports remain unchanged. +- Record the complete generator version in `.dynwinrt-generator.json`. Reject incompatible, unstamped, or corrupt existing generated output before changing files, including during `--dry-run`; same-version incremental generation remains supported. +- Warn when a final generated `.py`/`.pyi` path reaches the legacy 260-UTF-16-unit boundary. The warning identifies the longest final path and how much shorter the output root must be; it does not enable Windows long-path support or change names according to the output root. ### JavaScript/TypeScript and shared code generation - Reuse the existing projected Promise from generated async-with-progress `.toPromise()`. Repeated calls no longer register native completion twice; direct await and `.toPromise()` share the converted result or rejection. Pre-aborted signals also reuse their existing rejected Promise. - Retain explicit interface-method aliases as real JavaScript class methods with matching declarations. For example, `StorageFile` can satisfy `IStorageFile` inputs in strict TypeScript while keeping `copyAsync(...)` and adding the interface's `copyOverloadDefaultOptions(...)` alias. Existing overload dispatchers and `.as(...)` views remain supported. - Classify explicitly selected non-generic WinRT delegates correctly in both JavaScript and Python. Delegate-only, combined class/delegate, namespace, and incremental selections reuse the existing automatic-dependency projection; malformed or open-generic delegate roots fail explicitly. -- Warn before publishing generated Python output when a final `.py`/`.pyi` path reaches the legacy Windows 260-UTF-16-unit boundary. The diagnostic identifies the longest final path and how much shorter the output root must be, without changing generated names, layout, or bytes. ## Upgrade notes Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstall affected bindings. Generated Python manifests pin the matching runtime version; do not mix old generated packages or stubs with a different runtime. - **Python lifecycle:** initialize and balance each worker thread's own apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup tool; do not rely on garbage collection to close apartments or on a close to revoke external COM references. +- **Python regeneration and imports:** use a fresh output directory, or manually clean the dedicated generated-output directory and regenerate the entire selection. Do not remove or edit only the producer stamp. Direct imports of shortened long module names must migrate; prefer stable namespace imports such as `from generated.windows.foundation import Uri`. - **Python typing:** regenerate `.pyi` files together with their runtime modules. Cache potentially absent results and guard them before reading members. The Windows SDK nullable-result facts are not a universal nullability guarantee for custom or Windows App SDK metadata. - **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. It is a non-null native `IJsonValue`; Python `None` is not a substitute in stock JSON collections. - **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit tags or `PropertyType` for other widths, enums, empty/mixed arrays, and InspectableArray. Re-boxing preserves type and value, not box identity. @@ -66,6 +75,6 @@ Classic COM, flat Win32, and WinUI hosting remain experimental. This preview doe Embedded hosts retaining native aliases to Python-backed callbacks must stop new calls, settle in-flight callbacks, and call `shutdown_python_callbacks()` while Python is alive, before `Py_FinalizeEx`. Hosts skipping that protocol have only best-effort protection against callbacks during early interpreter finalization; no universal deadlock-free guarantee is claimed. -Python path warnings are diagnostic only. Use short output and venv paths, leaving headroom for pip staging and installation. No warning is not a guarantee that every downstream tool can open arbitrary long paths. +Python module shortening and compact staging reduce path risk but do not guarantee arbitrary checkout, package-name, build-temporary-directory, or venv depths. Use short paths and leave headroom for installation and bytecode caches; a missing warning is not a guarantee that every downstream tool can open the output. For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), [Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), and the [project README](https://github.com/microsoft/dynwinrt#readme). From 931840984d245c7b4994b8c0c42f62c4c6723011 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:43:52 +0800 Subject: [PATCH 07/16] Restore release installation and version guidance Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index e59873be..84c3160d 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -4,11 +4,17 @@ This preview improves Python apartment lifetime safety, collection reference com ## Packages and installation +Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. + - `@microsoft/dynwinrt` - JavaScript/TypeScript runtime. - `@microsoft/dynwinrt-codegen` - JavaScript/TypeScript code generator. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. +**Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. + +**Before using this version:** uninstall the previous runtime/codegen packages from the target environment and clean the old generated bindings and their build/install artifacts in the dedicated output location. Install the matching versions below and regenerate the complete bindings selection; do not mix old modules or stubs with the new runtime. + ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 npm install -D @microsoft/dynwinrt-codegen@0.1.0-preview.23 From 44d12d6f73275361d88de53842cc36b3f9cd920f Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:47:13 +0800 Subject: [PATCH 08/16] Update preview.23 collection notes and simplify cleanup Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 84c3160d..17833352 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -1,6 +1,6 @@ ## Prerelease v0.1.0-preview.23 -This preview improves Python apartment lifetime safety, collection reference comparisons, Object value conversion, and generated-package installation on Windows. It also strengthens Python callback, overload, and typing contracts, and fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises. These changes are relative to preview.22. +This preview improves Python apartment lifetime safety, collection comparisons and write contracts, Object value conversion, and generated-package installation on Windows. It also strengthens Python callback, overload, and typing contracts, and fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises. These changes are relative to preview.22. ## Packages and installation @@ -13,7 +13,7 @@ Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or **Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. -**Before using this version:** uninstall the previous runtime/codegen packages from the target environment and clean the old generated bindings and their build/install artifacts in the dedicated output location. Install the matching versions below and regenerate the complete bindings selection; do not mix old modules or stubs with the new runtime. +**Before using this version:** clean the old generated bindings. ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 @@ -37,6 +37,8 @@ Use `RoApartment.recover_pending()` on the owner thread for a guard deferred dur - Compare WinRT references by canonical COM identity in sequence containment, `index()`, `count()`, and `remove()`, mapping equality, and value/item-view membership. Class, interface, and raw views of the same object now match; distinct objects with equal content remain distinct. Ordinary Python value equality and wrapper equality/hashing outside these collection operations are unchanged. - Preserve mapping entry counts when Python keys alias the same native reference. Raw `Object` collections do not implicitly box or unbox for comparison; `object_value_view()` compares converted Python values normally and remaining native references by COM identity. +- Align `update()`, `setdefault()`, `extend()`, and `+=` input declarations with checked item writes across generated classes, interface views, Like protocols, `.pyi` stubs, and inline `.py` annotations. Read types remain unchanged, and native methods, properties, and aliases keep their existing names and dispatch. +- Return the stored read projection from `setdefault()` after inserting a missing key, without consuming the supplied input. A present key leaves its default unused; explicit `get()` and `pop()` fallback values remain unchanged. - Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated `Object`/`IInspectable` positions remain native by default; they do not implicitly box arbitrary Python values. - Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, and recursively unboxed InspectableArray values. `preserve_type=True`, numeric tags, typed arrays, and `PropertyType` retain exact WinRT type information through `dynwinrt.values`. - Add the opt-in live `dynwinrt.values.object_value_view()` for supported `IMap`/`IMapView` projections. Reads unbox and writes box explicitly; `.raw` retains access to the native map. @@ -45,7 +47,7 @@ Use `RoApartment.recover_pending()` on the owner thread for a guard deferred dur - Project supported delegate callback arguments from their actual `Invoke` signatures, including typed `MapChanged` senders and event arguments. - Unify method names, overloads, aliases, and collision handling across `.py` and `.pyi`. Preserve existing explicit ABI aliases and successful native dispatch targets, and use QueryInterface for compatible interface-typed overload inputs rather than requiring a particular wrapper class. -- Type `.pyi` outputs as non-null by default while preserving supported nullable positions, including `IReference`, `Try*` results, Object/delegate values, documented Windows SDK null results, and reference collection elements. Correct exact XML DOM declarations for absent roots, DTDs, node navigation, owner documents, and attribute lookup/replacement results. Runtime null conversion and the broader inline `.py` output annotations are unchanged. +- Type `.pyi` outputs as non-null by default while preserving supported nullable positions, including `IReference`, `Try*` results, Object/delegate values, documented Windows SDK null results, and reference collection elements. Correct exact XML DOM declarations for absent roots, DTDs, node navigation, owner documents, and attribute lookup/replacement results. Runtime null conversion and the existing inline `.py` nullability policy are unchanged. - Reject native null before mutating stock `JsonArray`/`JsonObject`, including bulk writes and generic interface views. Rejected null input leaves the collection unchanged; custom generic collections retain their valid native-null behavior. - QueryInterface-check direct generated interface construction before retaining a pointer. Validate array element contracts before taking independent native references, and reject Async receivers in low-level `call_0()`/`call_1()` before vtable dispatch. - Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and `RO_INIT_MULTITHREADED` constants. @@ -70,6 +72,7 @@ Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstal - **Python lifecycle:** initialize and balance each worker thread's own apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup tool; do not rely on garbage collection to close apartments or on a close to revoke external COM references. - **Python regeneration and imports:** use a fresh output directory, or manually clean the dedicated generated-output directory and regenerate the entire selection. Do not remove or edit only the producer stamp. Direct imports of shortened long module names must migrate; prefer stable namespace imports such as `from generated.windows.foundation import Uri`. - **Python typing:** regenerate `.pyi` files together with their runtime modules. Cache potentially absent results and guard them before reading members. The Windows SDK nullable-result facts are not a universal nullability guarantee for custom or Windows App SDK metadata. +- **Python collection defaults:** `setdefault()` follows the map's read projection rather than returning an unconverted input wrapper. Raw `Object`-valued maps return `DynWinRTValue | None`; project or unbox the result explicitly, or use `object_value_view()` on supported maps. - **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. It is a non-null native `IJsonValue`; Python `None` is not a substitute in stock JSON collections. - **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit tags or `PropertyType` for other widths, enums, empty/mixed arrays, and InspectableArray. Re-boxing preserves type and value, not box identity. - **JavaScript/TypeScript:** regenerate wrappers to obtain interface aliases and the progress Promise fix; upgrading the native runtime alone does not repair previously generated JavaScript. From 2a2774857d70965b57fee55eeacb6aeb175d7235 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:48:12 +0800 Subject: [PATCH 09/16] Place runtime requirements below the package list Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 17833352..6a2e0230 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -4,13 +4,13 @@ This preview improves Python apartment lifetime safety, collection comparisons a ## Packages and installation -Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. - - `@microsoft/dynwinrt` - JavaScript/TypeScript runtime. - `@microsoft/dynwinrt-codegen` - JavaScript/TypeScript code generator. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. +Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. + **Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. **Before using this version:** clean the old generated bindings. From f050fd314a2d7c8f9cd6b700f681679c63dd9180 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:49:22 +0800 Subject: [PATCH 10/16] List release requirements and upgrade guidance as bullets Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 6a2e0230..e44dc6c0 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -9,11 +9,12 @@ This preview improves Python apartment lifetime safety, collection comparisons a - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 or later; the Python runtime and generated bindings require CPython 3.11-3.14. Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. - -**Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. - -**Before using this version:** clean the old generated bindings. +- Runtime packages target Windows x64 and ARM64. +- JavaScript requires Node.js 18 or later. +- The Python runtime and generated bindings require CPython 3.11-3.14. +- Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. +- **Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. +- **Before using this version:** clean the old generated bindings. ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 From d6b21a117373054255428640b7a41fb08b3e6032 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 10:52:32 +0800 Subject: [PATCH 11/16] Unify release requirement labels and wording Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index e44dc6c0..5cf00032 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -9,12 +9,12 @@ This preview improves Python apartment lifetime safety, collection comparisons a - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -- Runtime packages target Windows x64 and ARM64. -- JavaScript requires Node.js 18 or later. -- The Python runtime and generated bindings require CPython 3.11-3.14. -- Available APIs also depend on the installed Windows version, SDK components, package identity, and hardware. -- **Version matching:** runtime and codegen packages must use the same version within each language ecosystem. Upgrade them together before regenerating bindings. -- **Before using this version:** clean the old generated bindings. +- **Runtime platforms:** Windows x64 and ARM64. +- **JavaScript version:** Node.js 18 or later. +- **Python version:** CPython 3.11-3.14 for the runtime and generated bindings. +- **API availability:** Depends on the Windows version, installed SDK components, package identity, and hardware. +- **Package versions:** Use the same runtime and codegen version for each language. +- **Upgrade cleanup:** Clean old generated bindings before using the new version. ```powershell npm install @microsoft/dynwinrt@0.1.0-preview.23 From ec4dbee71c278fe87dc43909edb56e78a3d504bf Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 11:02:09 +0800 Subject: [PATCH 12/16] Shorten release highlight sentences Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 5cf00032..2b2873ac 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -26,45 +26,45 @@ python -m pip install --pre "dynwinrt==0.1.0rc23" "dynwinrt-codegen==0.1.0rc23" ### Python apartment and native-owner safety -- Release library-owned raw values, generated wrappers, and COM-bearing arrays and structs before the final library-managed apartment close, including independently owned nested and cloned values. This protects ordinary `RoApartment` exits even without `projected_lifetime_scope()`. Retained Python owners report that they are released and reject further native access; scalar-only values and containers remain usable. -- Reject a final apartment close inside a synchronous native-to-Python callback before owner cleanup or `RoUninitialize`. Named guards remain active for retry after both the callback and outer native call return. -- Preserve successful nested and manual initialization counts, including `S_FALSE` and new initializations acquired by Python finalizers during owner cleanup. A close consumes only its own initialization. Failed cleanup retains that lease for retry without discarding newly acquired leases. -- Reject explicit apartment operations on the wrong OS thread without changing state. An implicit foreign-thread guard drop retains an owner-thread recovery token and emits a native diagnostic instead of calling COM there. -- Keep unsafe pending async owners from being released by apartment cleanup. Settle or explicitly cancel blocked work before retrying close; cleanup does not silently cancel it or consume externally owned COM aliases. +- Release library-owned COM references before the final managed apartment close. `projected_lifetime_scope()` is optional. +- Block final apartment teardown inside synchronous native callbacks. Preserve guards for recovery. +- Keep nested initialization counts balanced, including initialization during cleanup. Preserve failed closes for retry. +- Reject wrong-thread apartment closes without changing state. Preserve dropped guards for owner-thread recovery. +- Refuse cleanup of unsafe pending async owners. Cleanup does not silently cancel work. -Use `RoApartment.recover_pending()` on the owner thread for a guard deferred during a callback or dropped on another thread. For an unnamed guard whose owner cleanup failed, use `retry_pending_apartment_close()` or recover and explicitly close it after fixing the failure. The retry helper does not consume a callback-deferred lease. +Recover deferred guards with `RoApartment.recover_pending()` on the owner thread. Use `retry_pending_apartment_close()` for failed unnamed closes. ### Python collections and Object values -- Compare WinRT references by canonical COM identity in sequence containment, `index()`, `count()`, and `remove()`, mapping equality, and value/item-view membership. Class, interface, and raw views of the same object now match; distinct objects with equal content remain distinct. Ordinary Python value equality and wrapper equality/hashing outside these collection operations are unchanged. -- Preserve mapping entry counts when Python keys alias the same native reference. Raw `Object` collections do not implicitly box or unbox for comparison; `object_value_view()` compares converted Python values normally and remaining native references by COM identity. -- Align `update()`, `setdefault()`, `extend()`, and `+=` input declarations with checked item writes across generated classes, interface views, Like protocols, `.pyi` stubs, and inline `.py` annotations. Read types remain unchanged, and native methods, properties, and aliases keep their existing names and dispatch. -- Return the stored read projection from `setdefault()` after inserting a missing key, without consuming the supplied input. A present key leaves its default unused; explicit `get()` and `pop()` fallback values remain unchanged. -- Add `to_winrt_object(value, property_type=None)` for explicit boxing. Generated `Object`/`IInspectable` positions remain native by default; they do not implicitly box arbitrary Python values. -- Extend `unbox_object()` with DateTime, TimeSpan, Point/Size/Rect, their arrays, and recursively unboxed InspectableArray values. `preserve_type=True`, numeric tags, typed arrays, and `PropertyType` retain exact WinRT type information through `dynwinrt.values`. -- Add the opt-in live `dynwinrt.values.object_value_view()` for supported `IMap`/`IMapView` projections. Reads unbox and writes box explicitly; `.raw` retains access to the native map. +- Match class, interface, and raw references by COM identity in collection comparisons. Equality and hashing outside collections stay unchanged. +- Preserve mapping entry counts and ordinary Python value equality. Raw `Object` collections do not implicitly box or unbox. +- Align bulk-write input types with item assignment. Preserve native member names and dispatch. +- Return the stored read projection from `setdefault()`. Do not consume the caller's input. +- Add explicit Object boxing with `to_winrt_object()`. Generated Object positions remain native by default. +- Extend `unbox_object()` to DateTime, TimeSpan, geometry, and arrays. Retain exact WinRT types when requested. +- Add opt-in Object map views with `object_value_view()`. Reads unbox and writes box. `.raw` stays native. ### Python projection contracts -- Project supported delegate callback arguments from their actual `Invoke` signatures, including typed `MapChanged` senders and event arguments. -- Unify method names, overloads, aliases, and collision handling across `.py` and `.pyi`. Preserve existing explicit ABI aliases and successful native dispatch targets, and use QueryInterface for compatible interface-typed overload inputs rather than requiring a particular wrapper class. -- Type `.pyi` outputs as non-null by default while preserving supported nullable positions, including `IReference`, `Try*` results, Object/delegate values, documented Windows SDK null results, and reference collection elements. Correct exact XML DOM declarations for absent roots, DTDs, node navigation, owner documents, and attribute lookup/replacement results. Runtime null conversion and the existing inline `.py` nullability policy are unchanged. -- Reject native null before mutating stock `JsonArray`/`JsonObject`, including bulk writes and generic interface views. Rejected null input leaves the collection unchanged; custom generic collections retain their valid native-null behavior. -- QueryInterface-check direct generated interface construction before retaining a pointer. Validate array element contracts before taking independent native references, and reject Async receivers in low-level `call_0()`/`call_1()` before vtable dispatch. -- Improve Python runtime errors and expose named `RO_INIT_SINGLETHREADED` and `RO_INIT_MULTITHREADED` constants. -- Correct click-handler annotations in both Python Tic-Tac-Toe samples so they work with precise delegate typing, without changing game behavior or lifetime cleanup. +- Project typed delegate arguments from native signatures. Include typed `MapChanged` callbacks. +- Keep `.py` and `.pyi` overloads and aliases consistent. Accept compatible interface inputs through QueryInterface. +- Default `.pyi` outputs to non-null. Preserve supported nullable results, including XML DOM results. +- Reject native null in stock JSON writes before mutation. Keep valid nulls in custom generic collections. +- Validate interface construction and arrays before retaining native references. Reject Async receivers in `call_0()` and `call_1()`. +- Add named apartment constants and clearer runtime errors. +- Fix strict click-handler typing in both Python Tic-Tac-Toe samples. ### Python package generation and Windows paths -- Fix generated-package source and wheel installation failures under legacy Windows path limits by selectively shortening over-budget module paths with stable type-identity hashes and compacting setuptools build and wheel staging. Public type names and namespace exports remain unchanged. -- Record the complete generator version in `.dynwinrt-generator.json`. Reject incompatible, unstamped, or corrupt existing generated output before changing files, including during `--dry-run`; same-version incremental generation remains supported. -- Warn when a final generated `.py`/`.pyi` path reaches the legacy 260-UTF-16-unit boundary. The warning identifies the longest final path and how much shorter the output root must be; it does not enable Windows long-path support or change names according to the output root. +- Improve Windows installs with shorter module and staging paths. Keep public type names and namespace exports unchanged. +- Record the producer version in `.dynwinrt-generator.json`. Reject incompatible output before changing files. Keep same-version incremental generation. +- Warn when final generated paths reach the legacy Windows limit. ### JavaScript/TypeScript and shared code generation -- Reuse the existing projected Promise from generated async-with-progress `.toPromise()`. Repeated calls no longer register native completion twice; direct await and `.toPromise()` share the converted result or rejection. Pre-aborted signals also reuse their existing rejected Promise. -- Retain explicit interface-method aliases as real JavaScript class methods with matching declarations. For example, `StorageFile` can satisfy `IStorageFile` inputs in strict TypeScript while keeping `copyAsync(...)` and adding the interface's `copyOverloadDefaultOptions(...)` alias. Existing overload dispatchers and `.as(...)` views remain supported. -- Classify explicitly selected non-generic WinRT delegates correctly in both JavaScript and Python. Delegate-only, combined class/delegate, namespace, and incremental selections reuse the existing automatic-dependency projection; malformed or open-generic delegate roots fail explicitly. +- Reuse the projected Promise for repeated async-with-progress `.toPromise()` calls. Avoid duplicate native completion registration. +- Generate real interface-method aliases with matching TypeScript declarations. Keep existing overload dispatch unchanged. +- Handle explicitly selected non-generic WinRT delegates in JavaScript and Python. Reject malformed or open-generic delegate roots. ## Upgrade notes From e74595e49f88f3bf7343526b521bcd1149e6a373 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 11:09:54 +0800 Subject: [PATCH 13/16] Simplify release guidance and extend next-preview candidates Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 28 ++++++++++++++-------------- eng/release/UNRELEASED.md | 2 ++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 2b2873ac..5e25e858 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -68,23 +68,23 @@ Recover deferred guards with `RoApartment.recover_pending()` on the owner thread ## Upgrade notes -Upgrade runtime and codegen together, then fully regenerate and rebuild/reinstall affected bindings. Generated Python manifests pin the matching runtime version; do not mix old generated packages or stubs with a different runtime. +Upgrade runtime and codegen together. Regenerate bindings and rebuild/reinstall generated packages. Do not mix old bindings or stubs with the new runtime. -- **Python lifecycle:** initialize and balance each worker thread's own apartment. `projected_lifetime_scope()` remains an optional earlier-cleanup tool; do not rely on garbage collection to close apartments or on a close to revoke external COM references. -- **Python regeneration and imports:** use a fresh output directory, or manually clean the dedicated generated-output directory and regenerate the entire selection. Do not remove or edit only the producer stamp. Direct imports of shortened long module names must migrate; prefer stable namespace imports such as `from generated.windows.foundation import Uri`. -- **Python typing:** regenerate `.pyi` files together with their runtime modules. Cache potentially absent results and guard them before reading members. The Windows SDK nullable-result facts are not a universal nullability guarantee for custom or Windows App SDK metadata. -- **Python collection defaults:** `setdefault()` follows the map's read projection rather than returning an unconverted input wrapper. Raw `Object`-valued maps return `DynWinRTValue | None`; project or unbox the result explicitly, or use `object_value_view()` on supported maps. -- **Python JSON:** use `JsonValue.create_null_value()` for JSON semantic null. It is a non-null native `IJsonValue`; Python `None` is not a substitute in stock JSON collections. -- **Python Object conversion:** a plain `int` boxes as Int32 only. Use explicit tags or `PropertyType` for other widths, enums, empty/mixed arrays, and InspectableArray. Re-boxing preserves type and value, not box identity. -- **JavaScript/TypeScript:** regenerate wrappers to obtain interface aliases and the progress Promise fix; upgrading the native runtime alone does not repair previously generated JavaScript. -- **Rust source compatibility:** exhaustive matches on public `PropertyValueData` and `PropertyValueUnboxResult` must handle the new payload variants and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Keep `Null` and `NotPropertyValue` distinct and handle unsupported boxes explicitly. +- **Python lifecycle:** Balance each worker thread's apartment explicitly. `projected_lifetime_scope()` is optional. External COM references remain caller-owned. +- **Python regeneration:** Regenerate fully in a fresh or cleaned generated-output directory. Do not delete or edit only the producer stamp. Use namespace imports for shortened modules. +- **Python typing:** Regenerate `.py` and `.pyi` together. Guard nullable results before member access. SDK nullability facts are not universal. +- **Python collection defaults:** `setdefault()` returns the map's read projection. Raw `Object` maps return `DynWinRTValue | None`. Project or unbox results explicitly. +- **Python JSON:** Use `JsonValue.create_null_value()` for JSON null. Do not pass `None` to stock JSON collections. +- **Python Object conversion:** Plain `int` values box as Int32. Use tags or `PropertyType` for other types. Re-boxing does not preserve box identity. +- **JavaScript/TypeScript:** Regenerate wrappers for interface aliases and the progress Promise fix. A runtime-only upgrade does not update generated code. +- **Rust source compatibility:** Update exhaustive matches on `PropertyValueData` and `PropertyValueUnboxResult`. Handle new variants and `Unsupported(PropertyType)`. Keep `Null` and `NotPropertyValue` distinct. ## Known boundaries -Classic COM, flat Win32, and WinUI hosting remain experimental. This preview does not expand their support guarantees or remove the documented architecture-specific WinRT collection-producer limits. Native ARM64 live WinUI coverage remains incomplete; ordinary runtime-wheel checks do not establish full UI support. - -Embedded hosts retaining native aliases to Python-backed callbacks must stop new calls, settle in-flight callbacks, and call `shutdown_python_callbacks()` while Python is alive, before `Py_FinalizeEx`. Hosts skipping that protocol have only best-effort protection against callbacks during early interpreter finalization; no universal deadlock-free guarantee is claimed. - -Python module shortening and compact staging reduce path risk but do not guarantee arbitrary checkout, package-name, build-temporary-directory, or venv depths. Use short paths and leave headroom for installation and bytecode caches; a missing warning is not a guarantee that every downstream tool can open the output. +- **Experimental APIs:** Classic COM, flat Win32, and WinUI hosting remain experimental. +- **Collection producers:** Architecture-specific support limits remain unchanged. +- **ARM64 WinUI:** Native live coverage remains incomplete. +- **Embedded hosts:** Stop new calls and settle in-flight callbacks. Call `shutdown_python_callbacks()` before `Py_FinalizeEx`. Skipping this protocol leaves only best-effort protection. +- **Windows paths:** Short names do not remove all path limits. Keep output and venv paths short. A missing warning does not guarantee compatibility. For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), [Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), and the [project README](https://github.com/microsoft/dynwinrt#readme). diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 4400f5dc..89576c14 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -4,4 +4,6 @@ Potential improvements for the next preview: - Broader ABI-safe POD vector support for JavaScript and Python ([#161](https://github.com/microsoft/dynwinrt/issues/161), [#179](https://github.com/microsoft/dynwinrt/pull/179)). - Explicit Object-value conversion helpers for JavaScript/TypeScript, including boxing, typed unboxing, and opt-in map views. +- Initial Classic COM support for Python. +- Continued development of JavaScript/TypeScript Classic COM and flat Win32 bindings. - Smaller generated JavaScript by sharing implementation helpers ([#182](https://github.com/microsoft/dynwinrt/issues/182)). From 81acb68dbd76edb2267c31c072dabe437ba6ec41 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 11:25:55 +0800 Subject: [PATCH 14/16] Clarify next-preview COM and Win32 capability goals Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/UNRELEASED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 89576c14..4932c889 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -4,6 +4,6 @@ Potential improvements for the next preview: - Broader ABI-safe POD vector support for JavaScript and Python ([#161](https://github.com/microsoft/dynwinrt/issues/161), [#179](https://github.com/microsoft/dynwinrt/pull/179)). - Explicit Object-value conversion helpers for JavaScript/TypeScript, including boxing, typed unboxing, and opt-in map views. -- Initial Classic COM support for Python. -- Continued development of JavaScript/TypeScript Classic COM and flat Win32 bindings. +- Python Classic COM: generated wrappers, object activation, QueryInterface, and managed reference cleanup. +- JavaScript/TypeScript: managed COM interface replacement and broader flat Win32 buffer and resource contracts. - Smaller generated JavaScript by sharing implementation helpers ([#182](https://github.com/microsoft/dynwinrt/issues/182)). From 27bf3da0ca4ef806d7586bf3430504043af05f76 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 11:29:43 +0800 Subject: [PATCH 15/16] Remove Windows path caveat from release notes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/release/RELEASE_NOTES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index 5e25e858..7375c374 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -85,6 +85,5 @@ Upgrade runtime and codegen together. Regenerate bindings and rebuild/reinstall - **Collection producers:** Architecture-specific support limits remain unchanged. - **ARM64 WinUI:** Native live coverage remains incomplete. - **Embedded hosts:** Stop new calls and settle in-flight callbacks. Call `shutdown_python_callbacks()` before `Py_FinalizeEx`. Skipping this protocol leaves only best-effort protection. -- **Windows paths:** Short names do not remove all path limits. Keep output and venv paths short. A missing warning does not guarantee compatibility. For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), [Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), and the [project README](https://github.com/microsoft/dynwinrt#readme). From c4de40c5d597f48089edcb18ca72adafd2179045 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sat, 10 Oct 2026 14:35:23 +0800 Subject: [PATCH 16/16] Refresh documentation after main sample qualification Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 18 ++++++------- CLAUDE.md | 36 ++++++++++++++----------- samples/js/README.md | 1 + samples/js/windows-hello/README.md | 9 +++++-- samples/python/text-to-speech/README.md | 4 +++ 5 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2b696026..83baa5ab 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -20,13 +20,13 @@ model; see [the Win32 architecture](../docs/architecture/flat-win32-contracts.md # Build everything cargo build -# Core library tests (52 tests, 1 ignored — requires WinAppSDK) +# Core library tests (WinAppSDK-specific tests require their SDK inputs) cargo test -p dynwinrt -# dynwinrt-codegen tests (49 unit tests + 1 snapshot test) +# dynwinrt-codegen unit, integration, and snapshot tests cargo test -p dynwinrt-codegen -# Python binding (requires Python 3.8+ and maturin) +# Python binding (requires CPython 3.11-3.14 and maturin) cd bindings/py python -m venv .venv && .venv/Scripts/Activate.ps1 pip install pytest maturin @@ -111,12 +111,12 @@ semantics. Classic COM changes must preserve existing WinRT models, generated output, runtime behavior, and the `@microsoft/dynwinrt` root API. ### Code Generator (dynwinrt-codegen) -- `src/codegen/project.rs` + `src/codegen/projected.rs` — Build the language-neutral `ProjectedFile` IR from parsed metadata -- `src/codegen/render_js.rs` + `src/codegen/render_dts.rs` — Render IR to `.js` and `.d.ts` -- `src/codegen/python.rs` + `src/codegen/py_method.rs` + `src/codegen/python_stub.rs` — Python `.py` and `.pyi` generation -- `src/codegen/common.rs` — Shared helpers (type mapping, argument wrapping, return conversion) -- `src/codegen/typescript.rs` + `src/codegen/method.rs` — Index-file generation and ESM/CJS shim helpers (name is historical; no longer emits stand-alone `.ts` output) -- `--lang js` (default) generates `.js` + ambient `.d.ts` with the `DynWinRtType`/`DynWinRtValue` API (camelCase) +- `src/codegen/winrt/javascript/project/` + `ir.rs` — Build the JavaScript/TypeScript projection IR from parsed metadata +- `src/codegen/winrt/javascript/render/` — Render CommonJS `.js` and `.d.ts` declarations +- `src/codegen/winrt/javascript/generator.rs` — Index-file generation and ESM/CommonJS facades +- `src/codegen/winrt/python/generator/` + `stubs.rs` — Python `.py` and `.pyi` generation +- `src/codegen/winrt/shared/` — Shared WinRT dependency, import, and documentation helpers +- `--lang js` (default) generates CommonJS `.js`, ESM index facades, and `.d.ts` with the `DynWinRtType`/`DynWinRtValue` API (camelCase) - `--lang py` generates `.py`, `.pyi`, and a `py.typed` marker by default using the `DynWinRTType`/`DynWinRTValue` API (snake_case); `--no-pyi` opts out ### Python Binding API Names diff --git a/CLAUDE.md b/CLAUDE.md index 285c6738..8765fdfa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -109,22 +109,22 @@ napi-rs binding exposing: `DynWinRtType`, `DynWinRtMethodSig`, `DynWinRtMethodHa ### Python Binding (`bindings/py/`) -PyO3 binding exposing: `DynWinRTType`, `DynWinRTMethodSig`, `DynWinRTMethodHandle`, `DynWinRTValue`, `DynWinRTArray`, `DynWinRTStruct`, `DynWinRtDelegate`, `WinGUID`. Async operations block via `wait()` (releases GIL). Events use `DynWinRtDelegate.create()` with `Python::attach()` for GIL-safe callback invocation. +PyO3 binding exposing: `DynWinRTType`, `DynWinRTMethodSig`, `DynWinRTMethodHandle`, `DynWinRTValue`, `DynWinRTArray`, `DynWinRTStruct`, `DynWinRtDelegate`, `WinGUID`. Generated async operations support `asyncio`; the low-level `wait()` fallback blocks with the GIL released. Events use `DynWinRtDelegate.create()` with `Python::attach()` for GIL-safe callback invocation. ### Code Generation Tool (`dynwinrt-codegen`, source in `tools/dynwinrt-codegen/`) Reads .winmd metadata and generates typed wrapper code: -- `--lang js` (default): emits ESM `.js` + ambient `.d.ts` (no tsc step required) using the `DynWinRtType`/`DynWinRtValue` API +- `--lang js` (default): emits CommonJS `.js`, ESM index facades, and `.d.ts` declarations using the `DynWinRtType`/`DynWinRtValue` API; no tsc step is required - `--lang py`: Python classes using the `DynWinRTType`/`DynWinRTValue` API, with `.pyi` stubs and a `py.typed` marker by default; `--no-pyi` opts out - Handles: classes, interfaces, enums, structs (pack/unpack), delegates (IID + param types), async operations (with `AbortSignal`/cancellation), generic collections, events - Auto-detects Windows SDK winmd, auto-discovers sibling `.winmd` files in the same directory, resolves transitive dependencies Key codegen modules: -- **codegen/common.rs**: Shared helpers — type mapping, method sig building, struct field accessors, argument wrapping, return conversion (both JS and Python variants) -- **codegen/project.rs** + **codegen/projected.rs**: Build `ProjectedFile` IR from metadata -- **codegen/render_js.rs** + **codegen/render_dts.rs**: Render IR to `.js` and `.d.ts` -- **codegen/python.rs** + **codegen/py_method.rs** + **codegen/python_stub.rs**: Python `.py` and `.pyi` generation -- **codegen/typescript.rs** + **codegen/method.rs**: Legacy TS generators (still used by some code paths) +- **codegen/winrt/shared/**: Shared WinRT dependency, import, and documentation helpers +- **codegen/winrt/javascript/project/** + **ir.rs**: Build the JavaScript/TypeScript projection IR from metadata +- **codegen/winrt/javascript/render/**: Render CommonJS `.js` and `.d.ts` declarations +- **codegen/winrt/javascript/generator.rs**: Index-file generation and ESM/CommonJS facades +- **codegen/winrt/python/generator/** + **stubs.rs**: Python `.py` and `.pyi` generation - **meta.rs**: WinMD parsing — classes, interfaces, enums, methods, parameters, vtable indices - **types.rs**: `TypeMeta` enum describing WinRT types extracted from metadata - **xml_doc.rs**: Loads sibling `.xml` files (C# /doc format) to inject JSDoc/docstrings @@ -136,9 +136,9 @@ Tests use real Windows APIs without mocking: - **Core Rust tests** (`cargo test -p dynwinrt`): Uri, HttpClient (async), XmlDocument, metadata reading, vector/map collections - **dynwinrt-codegen tests** (`cargo test -p dynwinrt-codegen`): Snapshot tests for Uri TypeScript output, unit tests for type mapping/codegen - **Python binding tests** (`bindings/py/tests/`): - - `test_basic.py` (27 tests): All binding features — primitives, GUID, arrays, structs, enum, URI E2E - - `test_e2e_winrt.py` (19 tests): Real WinRT APIs — XmlDocument, Geopoint, PropertyValue, Buffer, Uri - - `test_runtime.py` (5 tests): Value conversion utilities + - `test_basic.py`: Binding features — primitives, GUID, arrays, structs, enum, URI E2E + - `test_e2e_winrt.py`: Real WinRT APIs — XmlDocument, Geopoint, PropertyValue, Buffer, Uri + - `test_runtime.py`: Value conversion utilities ## Common Patterns @@ -173,23 +173,27 @@ let delegate = dynwinrt::delegate::create_delegate_value( ```rust // Core: WinRTValue::Async implements Future let result = async_value.await?; +``` +```js // JS: returns Promise -let result = value.toPromise().await?; +const result = await value.toPromise(); +``` -// Python: blocks with GIL released -let result = value.wait()?; +```python +result = await generated_async_operation +result = value.wait() # Low-level blocking fallback; releases the GIL. ``` ## Known Limitations - Delegate callbacks support up to 2 ABI parameters (covers ~95% of WinRT delegates) -- No DispatcherQueue / XAML hosting support (data APIs only, no UI framework) — WinUI-style controls need composition/aggregation of runtime classes, which the codegen skips (see composable `.ctor` note in `docs/status/TODO.md`) -- Python binding does not yet support async/await integration with `asyncio` +- WinUI/XAML hosting and DispatcherQueue support remain experimental and require matching Windows App SDK metadata and runtime inputs. +- Python generated async operations integrate with `asyncio`; synchronous interface-implementation callbacks must not return coroutines. ## Environment Setup — updated invariant -`initialize_winappsdk()` currently `.expect(...)`s the `WINAPPSDK_BOOTSTRAP_DLL_PATH` environment variable at `crates/dynwinrt/src/winapp.rs:43`. Auto-detection from `~/.winapp/packages/`, `~/.nuget/packages/microsoft.windowsappsdk.*/`, and Program Files install paths is tracked in `docs/status/TODO.md` P0. +Windows App SDK bootstrap requires an explicit `bootstrap_dll_path` or `WINAPPSDK_BOOTSTRAP_DLL_PATH`. Missing paths, invalid versions, and DLL/export failures return errors; they do not panic. Samples restore or select matching SDK inputs explicitly. Bootstrap-path auto-discovery is not implemented. ## Implementation Notes diff --git a/samples/js/README.md b/samples/js/README.md index 84cf03da..88d3f598 100644 --- a/samples/js/README.md +++ b/samples/js/README.md @@ -10,6 +10,7 @@ The application samples below use generated bindings and the | [`windows-hello`](windows-hello/) | Electron, Windows Hello, and HWND-bound Classic COM interop | | [`electron-share-ui`](electron-share-ui/) | Electron Share UI with WinRT and Classic COM | | [`electron-smtc`](electron-smtc/) | Electron system media controls and GSMTC loopback | +| [`electron-aion-chat`](electron-aion-chat/) | Local Aion streaming chat in Electron; requires Snapdragon ARM64, QNN, and the Aion preview framework | | [`interface-implementation`](interface-implementation/) | Standalone JavaScript-backed WinRT interfaces, native IBackgroundTask calls, and multi-interface lifetime | | [`win32`](win32/) | Generated Win32 DLL exports, Registry buffers and handle cleanup, and IOCP-backed asynchronous file I/O | | [`ocr`](ocr/) | Windows AI TextRecognizer OCR, generated bindings, interactive picker or `--image`, and private WinApp CLI identity | diff --git a/samples/js/windows-hello/README.md b/samples/js/windows-hello/README.md index b5864ca6..c579e9bd 100644 --- a/samples/js/windows-hello/README.md +++ b/samples/js/windows-hello/README.md @@ -14,8 +14,10 @@ native addon, without requiring sample-specific C++ or `node-gyp`. - Windows 10 or 11; - Windows Hello configured for the current user; -- Node.js and Rust/Cargo; and -- a Windows SDK containing `Windows.winmd`. +- Node.js and Rust/Cargo; +- a Windows SDK containing `Windows.winmd`; and +- `Microsoft.Windows.SDK.Win32Metadata` containing `Windows.Win32.winmd` + for the Classic COM interop projection. ## Run @@ -36,6 +38,9 @@ npm run generate npm start ``` +Set `DYNWINRT_WIN32_WINMD` to the metadata file when it is outside the default +`$HOME\.nuget\packages` cache. + Click **Verify identity**. Windows displays its native verification dialog owned by the Electron window. Complete or cancel the prompt; the result is shown in the application. diff --git a/samples/python/text-to-speech/README.md b/samples/python/text-to-speech/README.md index 3d43694b..63054b02 100644 --- a/samples/python/text-to-speech/README.md +++ b/samples/python/text-to-speech/README.md @@ -13,6 +13,7 @@ to generated dynwinrt bindings. It demonstrates: ## Prerequisites - Windows 10 or 11 with a Windows SDK installed; +- an active audio output device for playback; - `dynwinrt` installed in the selected Python interpreter; and - `dynwinrt-codegen` on `PATH`, or passed to `generate.ps1` with `-Codegen`. @@ -33,3 +34,6 @@ For non-interactive validation, synthesize the stream without playing it: ```powershell .\run.ps1 -Python C:\path\to\python.exe -Smoke ``` + +`-Smoke` validates synthesis, not playback. In headless or remote sessions without +an audio output, playback may time out because Windows cannot create a media sink.