Skip to content

Windows test roots: paths, prefix map, PDB reproducibility, void-pointer MIR, typed-dump speed (#2476) - #2477

Merged
ehartford merged 20 commits into
mainfrom
winarm-test-roots
Oct 20, 2026
Merged

ehartford merged 20 commits into
mainfrom
winarm-test-roots

Conversation

@ehartford

@ehartford ehartford commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the Windows (x86_64 and aarch64) :test reds tracked in #2476, one commit per root cause.

Compiler

Tests and harness

  • LLP64 fixture (err_2179), behav_d94, behav_std_process_command, behav_c_import_owning_wrapper_fopen, and behav_1417 assumed a Unix host. pre_d_build_runner drops Windows-reserved characters from capture directory names. The complexity harness repeats work until the 15.6 ms Windows CPU clock moves. Object-symbol checks use the SDK's llvm-nm.

Evidence

  • Battery GREEN on 9de323b (with run tools/battery.w, rc=0, 314 s). Gate green; :drop-audit green; audit:resolution 0 violations on the new test.
  • Native Windows x86_64 (win10): full src/main.exe build :test at 9de323b, every test target green (only test-green, which needs the selfcheck state from a :fixpoint run, was not recorded).
  • Not reproduced off the aarch64 runner: behav_2117 (timing assertion) and the aarch64-only timeouts; the post-merge lane reports them under D137.

Eric Hartford added 19 commits October 19, 2026 19:33
… target's resolved width (#2476)

'case UL_SETFSIZE: *mut c_long' printed as '*mut i64' on LP64 and '*mut i32' on Windows; the message quotes the programmer's case, so it now slices their spelling (Sema.source_spelling).
…very target (#2476)

On LLP64 Windows C long is i32 like int, so the facade correctly had one status type and the expected failure never came.
codegen_canonical_module_path tested path[0] == '/', so C:\w\x.w was joined onto the cwd. The test's expectation also skipped the '/' normalization the canonical path applies to getcwd's C:\a\b.
…t maps (#2476)

A map spelled C:\a\with never matched the '/'-normalized canonical path, so a Windows build kept the checkout path in panic sites and debug info.
The .Windows arm called a function that exists nowhere, so the test held only on hosts where that arm is not taken.
#2476)

run() shares the child's stdout; whoami and where printed into the test's expected output. where /q keeps the same exit-code contract silently.
…, not /tmp (#2476)

Windows has no /tmp, so fopen correctly returned None and the test's unwrap panicked.
…haracters (#2476)

A label is often a build target (':plain'); Windows refuses ':' in a file name, so mkdir_p failed before the case ran.
…#2476)

The calling convention is unchanged; a Windows drive-letter path and a backslash prefix map now canonicalize, which every .wo hash keys on.
…2476)

Windows parses as its gnu target (#1915), whose C library (mingw-w64 _mingw.h) defines __unaligned empty; without a system header the MSVC keyword was not C for the target, and clang refused the snippet.
… the project root (#2476)

It was written into the source directory for the length of its build, so a concurrent listing of that directory ran it as a test (windows-x86_64 with-test) or read it after it was removed (validate-all-async panic: read_text of __with_compiler_hook_runner.*.w). Compilation.set_import_root_dir names the root both resolvers fall back to.
…s 50 ms (#2476)

Windows counts process CPU time in 15.6 ms ticks, so a short run measured 0 and stdlib.w:223 asserted. Same verdicts on darwin (9.6 s -> 15.8 s).
…unks (#2476)

contextual_join_dump_text appended per arm with ++, quadratic in a join's arms; a 131072-element array literal in the compiler's modules made it the whole cost of dump_typed_top_level_string_sidecar_key (sample: 93% in str_concat memcpy), which timed out on both Windows lanes. Same 99 MB output byte for byte; 236 s -> 72 s on darwin.
…assignment or return (#2476)

let q: *mut c_void = p was an internal compiler error (use rvalue type is incompatible with assign destination) while the argument and field forms passed. The validator mirrors Sema's pointer_pointees_compatible arm from the void-like type ids Sema classifies, mutability included.
Sema.source_path_text (panic sites kept C:\...\main.w unmapped), with cc's own-executable path, the recipe interpreter's os.path.join, and with uat's join and abs each tested for a leading '/'; they use runtime_path_is_absolute.
str is a value (D111); the ceremony census caught the clone.
The PE debug directory held the PDB's absolute link path, so a tool built under WITH_FILE_PREFIX_MAP still named its case directory and differed per directory (behav_2016_build_store_in_process_env.w:36 on both Windows lanes).
…ths and /pdbsourcepath (#2476)

lld-link records its cwd, command line and object paths in the PDB, and /Brepro hashes the image after the PDB has given it a GUID, so a tool linked in two case directories differed (behav_2016:55). The Windows counterpart of the Mach-O link's -oso_prefix.
…2476)

Mapping every absolute path made a Windows C:\a\t\b.w panic location read C:/a/t/b.w, against #1953's byte-for-byte rule (behav_1953 on win10); D50's mapped spelling applies where WITH_FILE_PREFIX_MAP's <from> covers the path (FnAbi.fn_abi_file_prefix_map_names, one rule for both).
…2476)

$NM, else the SDK's llvm-nm, else the target's arg: a Windows host need have no nm (cli-selfhost-object-symbol-tests and bundle-interface-tests failed on win10), and a host binutils nm cannot read COFF-ARM64 (the arm64 lane set NM by hand).
@ehartford ehartford changed the title Windows test roots: canonical paths, prefix map, LLP64 fixtures, portable test probes (#2476) Windows test roots: paths, prefix map, PDB reproducibility, void-pointer MIR, typed-dump speed (#2476) Oct 20, 2026
@ehartford
ehartford marked this pull request as ready for review October 20, 2026 02:49
@ehartford
ehartford merged commit 748f8a4 into main Oct 20, 2026
@ehartford
ehartford deleted the winarm-test-roots branch October 20, 2026 02:49
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.

1 participant