Skip to content

Added complete USBX Windows simulator regression support - #273

Merged
fdesbiens merged 14 commits into
eclipse-threadx:devfrom
fdesbiens:windows-sim-refresh-2026-09-01
Oct 1, 2026
Merged

fdesbiens merged 14 commits into
eclipse-threadx:devfrom
fdesbiens:windows-sim-refresh-2026-09-01

Conversation

@fdesbiens

@fdesbiens fdesbiens commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

USBX had no Windows regression capability. The suite built and ran on Linux only, so defects specific to MSVC, to the LLP64 model and to the Windows simulator's tick behaviour could be found only by hand, if at all.

This adds Win64 and Win32 simulator ports for the regression suite, with architecture-selectable PowerShell entry points driving CMake, Ninja and the MSVC Build Tools, so nothing depends on the Visual Studio IDE. Windows timing is supplied through compile-time overrides rather than edits to shared test code: the simulator connect and disconnect sleeps, the enumeration debounce and a tick scale factor are macros whose Linux defaults reproduce the previous behaviour exactly, with the reduced values confined to the MSVC branch of the build. Genuine portability defects surfaced along the way and are fixed, including Win32 HID initialisation and pointer-width arithmetic.

Two consequences a reviewer would not predict from the diff. Twenty-seven regression sources came back from the Windows editor carrying a UTF-8 byte order mark, which has been stripped; those files are in the diff for their real changes, not for the mark. And the PowerShell helper now resolves its ThreadX, FileX and NetX Duo locations to sibling directories named after the upstream repositories, where it previously used names from one local checkout and failed for everyone else; -ThreadXDir, -FilexDir and -NetxduoDir override for a different layout.

Win64 430/430 and Win32 430/430, measured before the final comment, byte order mark and default path commits. On Linux, 433/433 default, 35/35 msrc_rtos and 45/45 standalone-host on the current head, with the AI disclosure check passing.

Depends on eclipse-threadx/threadx#736, eclipse-threadx/filex#100 and eclipse-threadx/netxduo#437, all merged.

Comment thread scripts/build_usbx.ps1 Outdated
}

if (-not $ThreadXDir) {
$ThreadXDir = Join-Path (Split-Path -Parent $repoRoot) 'threadx-fd'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

threadx or threadx-fd ?
same for filex/netxduo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, and it was a real defect rather than a naming question. The defaults now resolve to threadx, filex and netxduo. The suffixed names came from a local checkout and would not have resolved for anyone else, so the script failed out of the box. -ThreadXDir, -FilexDir and -NetxduoDir still override for a different layout.

Comment thread test/regression/ux_test_hcd_sim_host.c Outdated
@@ -1,4 +1,5 @@
/***************************************************************************/
// Portions of this file were generated with AI assistance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be move under banner

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The line sat between the banner's opening line and the first copyright line, splitting the banner open; it now follows the banner close.

Three other files in this branch had it in the same position and were corrected too: ux_host_class_dummy.c, usbx_class_multi_interface_enumeration_test.c and usbx_ux_host_class_hid_logitech_pro_x_superlight_test.c.

@fdesbiens
fdesbiens marked this pull request as ready for review September 30, 2026 19:29
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
Assisted-by: Codex (gpt-5.6-sol) <codex@openai.com>
The branch added the older per-edit disclosure, which names the product and the
model version. That form accumulates: a second agent, or the same agent on a
newer model, appends another line rather than recognising the one already there,
and the spelling drifts with every release.

All 50 lines become the fixed text, written with the comment character each file
uses -- `//` in C sources and headers, `#` in CMakeLists and PowerShell:

    Portions of this file were generated with AI assistance.

Attribution for the change itself stays on the commit, in the Assisted-by
trailer. The AI Disclosure headers on the files this branch creates are
unchanged, and keep naming their product and model: a file is created once, so
that record cannot grow.

Comment-only, one line replaced per file, no file left with zero or more than
one. The new-file AI Disclosure headers are untouched.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
The rebase onto a dev that already carried the fixed disclosure line added a
second one, which the check rejects: a file carries at most one, ever.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
@fdesbiens
fdesbiens force-pushed the windows-sim-refresh-2026-09-01 branch from a113f83 to d0ee905 Compare October 1, 2026 13:53
The build helper defaulted its ThreadX, FileX and NetX Duo locations to
directory names that exist only in one contributor's checkout, so the script
failed out of the box for everyone else. Separately, four regression sources
carried the AI disclosure comment between the first and second lines of the
licence banner, splitting the banner open.

The helper now defaults to the upstream repository names; -ThreadXDir,
-FilexDir and -NetxduoDir still override. The disclosure comment moved below
the banner in all four files, and build_usbx.ps1 kept only its AI Disclosure
paragraph, the one-line form being for files that carry no disclosure.

433/433 default, 35/35 msrc_rtos, 45/45 standalone-host. Disclosure check
passing.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
Twenty-seven regression sources edited on Windows came back with a UTF-8 byte
order mark on the first line. None of them carried one before, and no other
file in the repository does. GCC and MSVC both tolerate it, but it corrupts
the first line of every diff against these files and not every toolchain in
the port matrix accepts it.

The mark is stripped from all twenty-seven. Nothing else in those files
changed.

433/433 default, 35/35 msrc_rtos, 45/45 standalone-host. No byte order mark
remains anywhere in the tree.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
@fdesbiens
fdesbiens merged commit b1727ae into eclipse-threadx:dev Oct 1, 2026
5 checks passed
@fdesbiens
fdesbiens deleted the windows-sim-refresh-2026-09-01 branch October 1, 2026 14:44
fdesbiens added a commit that referenced this pull request Oct 2, 2026
The tree still advertised 6.5.1.202602 everywhere, while the release going out is
6.5.2.202603.

The version constants in common/core/inc/ux_api.h move to 6.5.2.202603, and 31 of the
33 port headers follow. The remaining two are the Win32 and Win64 simulator ports added
in #273, which were written against the target version and already carried it.

433/433 default, 35/35 msrc_rtos, 45/45 standalone-host. No port header advertises
another release: the stale-port check added in #288 passes, which it would not have
done before that fix, since a port whose string is shaped unexpectedly used to be
skipped without a word.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants