Skip to content

Commit c41cd91

Browse files
committed
Merge remote-tracking branch 'origin/main' into move-epoll
# Conflicts: # src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Wasi.cs # src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Wasi.cs # src/native/libs/System.Native/pal_networking_browser.c
2 parents 4cc68fb + edbf659 commit c41cd91

1,147 files changed

Lines changed: 36825 additions & 15851 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"microsoft.dotnet.xharness.cli": {
18-
"version": "11.0.0-prerelease.26204.1",
18+
"version": "11.0.0-prerelease.26279.1",
1919
"commands": [
2020
"xharness"
2121
]

.github/skills/ci-pipeline-monitor/pipelines.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ cached mapping table).
3737
| runtime-coreclr libraries-pgo | |
3838
| runtime-coreclr pgostress | |
3939
| runtime-coreclr jit-cfg | Sat-Sun 22:00 UTC | Control flow guard. |
40+
| runtime-coreclr crossgen2 | Daily | Crossgen2 R2R + comparison tests. |
41+
| runtime-coreclr crossgen2 outerloop | Daily | Crossgen2 outerloop R2R tests. |
42+
| runtime-coreclr crossgen2-composite | Daily | Crossgen2 composite R2R tests. |
43+
| runtime-coreclr crossgen2-composite gcstress | Weekends | Crossgen2 composite with GC stress. |
4044

4145
## Cached Definition ID Mapping
4246

@@ -64,6 +68,10 @@ entries via the AzDO Definitions API, and adds new rows here.
6468
| runtime-coreclr superpmi-replay | 150 | |
6569
| runtime-coreclr superpmi-asmdiffs-checked-release | 153 | |
6670
| runtime-coreclr jit-cfg | 155 | |
71+
| runtime-coreclr crossgen2 | 124 | |
72+
| runtime-coreclr crossgen2 outerloop | 134 | |
73+
| runtime-coreclr crossgen2-composite | 136 | |
74+
| runtime-coreclr crossgen2-composite gcstress | 141 | |
6775
| runtime-coreclr jitstress-random | 159 | |
6876
| runtime-coreclr libraries-jitstress-random | 160 | |
6977
| runtime-coreclr pgostress | 230 | |

.github/workflows/ci-failure-scan-feedback.md

Lines changed: 57 additions & 76 deletions
Large diffs are not rendered by default.

.github/workflows/ci-failure-scan.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ For each row in the pipeline table below:
159159
| runtime-coreclr r2r | 120 | |
160160
| runtime-coreclr gc-simulator | 123 | |
161161
| runtime-coreclr crossgen2 | 124 | |
162+
| runtime-coreclr crossgen2 outerloop | 134 | |
163+
| runtime-coreclr crossgen2-composite | 136 | |
164+
| runtime-coreclr crossgen2-composite gcstress | 141 | Weekends |
162165
| runtime-jit-experimental | 137 | OSR / partial compilation |
163166
| runtime-coreclr libraries-jitstress | 138 | |
164167
| runtime-coreclr ilasm | 140 | |
@@ -231,6 +234,14 @@ test -f /tmp/gh-aw/agent/filed.tsv && cut -f1 /tmp/gh-aw/agent/filed.tsv | grep
231234
printf '%s\t%s\n' "$key" "aw_<id>" >> /tmp/gh-aw/agent/filed.tsv # after emit
232235
```
233236

237+
**Cross-definition dedup (check second).** A KBE matches on signature text regardless of which pipeline definition produced it, so do NOT file a second KBE for a signature already filed this run under a different `definition_id`. After the exact-key check above misses, also check the definition-independent key `<queue>|<stress_mode>|<signature_norm>`. On match, record `skipped: cross-def dup of filed-issue #aw_<id> earlier in this run` and stop. Do NOT proceed to Branch B: `aw_<id>` is a safe-output ID from this run, not a real issue number, and rule #9 forbids same-run test-disable PRs. The per-definition test-disable PR (if test-disable is welcome on the resulting KBE) will surface on the next run, once the KBE has a real issue number. Append this key too after every Branch A emission.
238+
239+
```bash
240+
xkey="<queue>|<stress_mode>|${signature_norm}"
241+
test -f /tmp/gh-aw/agent/filed.tsv && cut -f1 /tmp/gh-aw/agent/filed.tsv | grep -Fxq "$xkey" # cross-def dup if exit 0
242+
printf '%s\t%s\n' "$xkey" "aw_<id>" >> /tmp/gh-aw/agent/filed.tsv # after emit
243+
```
244+
234245
#### Step 4.1 — Load the matching skill
235246

236247
| Pipeline category | Skill |
@@ -250,6 +261,15 @@ Follow exactly these sections from `.github/workflows/shared/create-kbe.instruct
250261
3. `<a id="search-existing-prs"></a>` / `## Search for existing PRs already handling the failure`
251262
4. `<a id="verify-embedded-issues"></a>` / `## Verify every embedded issue number exists`
252263

264+
When searching, account for the fact that the same signature can be filed in
265+
different `ErrorMessage` representations. A KBE recorded in `<a id="kbe-array-form"></a>`
266+
multi-line array form will not surface from a single-substring search, and vice
267+
versa. Before concluding "no existing KBE", also search each individual array
268+
element / log line of the signature on its own (not just the joined form), and
269+
search the most distinctive single substring even when you intend to file the
270+
array form. If any of these variant-form searches surfaces a candidate, treat it
271+
as `existing-kbe` rather than filing a duplicate.
272+
253273
Record the same outcomes described there:
254274

255275
- `existing-kbe #<n>`
@@ -261,7 +281,8 @@ Record the same outcomes described there:
261281

262282
Read the candidate KBE / tracker body + the latest 5 comments (not just the most recent). Also read the body + latest 5 comments of ANY issue referenced in the KBE body (e.g. `refs #<n>`, `Tracking: dotnet/runtime#<n>`) — maintainer signals on the root-cause issue override the KBE. Skip the test-disable (record `-> skipped: do-not-disable on issue #<n>`) if ANY of:
263283

264-
- Body or recent comment from any `MEMBER`/`OWNER` mentions one of (case-insensitive): `please don't disable`, `do not mute`, `do not disable`, `keep failing`, `investigation in progress`, `fix-forward`, `fix forward`, `should be supported`, `will investigate`, `wait for #`, `landing in #`.
284+
- Body or recent comment from any `MEMBER`/`OWNER` mentions one of (case-insensitive): `please don't disable`, `do not mute`, `do not disable`, `keep failing`, `investigation in progress`, `fix-forward`, `fix forward`, `should be supported`, `will investigate`, `wait for #`, `landing in #`, `trying to understand`, `without disabling`, `i'm fixing`, `i am fixing`, `understand the problem`, `investigating root cause`, `find the root cause`.
285+
- Heuristic catch-all: any `MEMBER`/`OWNER` comment expressing investigation or fix-forward intent, even when no exact phrase above matches. Treat first-person statements about understanding, diagnosing, or fixing the failure (e.g. "I'm looking into this", "we should understand why", "I'd rather fix the pipeline than mute") as a do-not-disable signal. When the comment reads as a maintainer choosing to investigate rather than mute, skip the test-disable.
265286
- Issue carries a label semantically equivalent to "do not mute" (verify the label exists in `dotnet/runtime` before relying on it; do not invent labels).
266287
- Most recent area-owner comment within the last 14 days opposes disabling on procedural grounds.
267288
- A prior `[ci-scan]` test-disable PR for the same test (or same KBE `#<n>`) was **closed without merge** within the last 30 days. Search `is:pr is:closed -is:merged "<test-name>" "[ci-scan]" closed:>=<30-days-ago>` and `is:pr is:closed -is:merged "#<n>" "[ci-scan]" closed:>=<30-days-ago>` (compute `<30-days-ago>` as the ISO date 30 days before the scan run). For each hit, fetch the PR comments and skip if any commenter with `authorAssociation` `MEMBER` or `OWNER` used any of the keywords listed above. The combination of a maintainer pushback comment plus a non-merge close is the do-not-disable signal; the closer does not need to be the same maintainer. Re-filing requires fresh evidence such as a new maintainer comment on the KBE greenlighting the disable, or a clearly different failure signature. Record `-> skipped: do-not-disable, prior PR #<n> closed without merge after maintainer pushback`.
@@ -290,12 +311,16 @@ No meta / aggregate / outage issues. Every KBE is keyed to a single `(definition
290311

291312
**Branch A — No existing KBE; signature is stable.**
292313

293-
Stable means >= 2 occurrences in the ~10-build window, OR a build break that fails all legs of the current build (block-everyone severity that warrants filing on first sight). Emit one `create_issue` using exactly the shared new-KBE template from `.github/workflows/shared/create-kbe.instructions.md` section `<a id="new-kbe-template"></a>` / `## New-KBE template`, including whichever of `<a id="literal-kbe-template"></a>` / `### KBE issue body - literal substring match`, `<a id="regex-kbe-template"></a>` / `### KBE issue body - regex match`, or `<a id="kbe-array-form"></a>` / `### KBE multi-line array form` fits the signature. Apply both `Known Build Error` and `blocking-clean-ci` labels so the org project auto-add rule picks it up; do NOT try to mutate the project from this workflow. Append to the same-run dedup cache (Step 4.0) after emission.
314+
Stable means >= 2 occurrences across >= 2 distinct builds in the ~10-build window, OR a build break that fails all legs of the current build (block-everyone severity that warrants filing on first sight). Multiple legs, retries, or work items of the SAME build (same build id) count as a single occurrence, not two — a one-off failure that appears in only one build is NOT stable; record `skipped: < 2 occurrences and not blocking` and let the next run revisit. Emit one `create_issue` using exactly the shared new-KBE template from `.github/workflows/shared/create-kbe.instructions.md` section `<a id="new-kbe-template"></a>` / `## New-KBE template`, including whichever of `<a id="literal-kbe-template"></a>` / `### KBE issue body - literal substring match`, `<a id="regex-kbe-template"></a>` / `### KBE issue body - regex match`, or `<a id="kbe-array-form"></a>` / `### KBE multi-line array form` fits the signature. Apply both `Known Build Error` and `blocking-clean-ci` labels so the org project auto-add rule picks it up; do NOT try to mutate the project from this workflow. Append to the same-run dedup cache (Step 4.0) after emission.
315+
316+
**Match-count gate.** Reject the emit if the body lacks `<!-- ci-scan-match-count: <N> hits in failure.log -->` with `N >= 1`. Treat an absent marker as `N=0` and record the same skip reason check #7 of the shared instructions uses: `skipped: signature did not match failure.log (N=<count>)`. Rationale, log-source caveats, and native-assert handling live in check #7.
294317

295318
If the shared KBE lookup flow recorded `linked-tracker #<tracker>`, cross-link it as `Tracking: dotnet/runtime#<tracker>` in the KBE body. Test-disable PR is deferred to the next run.
296319

297320
**Branch B — Existing KBE; no test-disable PR; test-disable is welcome (Step 4.7 clean).**
298321

322+
Before emitting, re-confirm the linked KBE is still `open`. If it has been closed (fixed, not planned, or duplicate), do NOT emit a test-disable PR against it — an orphaned PR referencing a closed KBE has no tracking issue to gate its revert. Record `skipped: linked KBE #<n> is closed` and stop for this signature; the next run will re-evaluate via Step 4.2 and may file a fresh KBE through Branch A if the failure still recurs. Do not fall through to Branch A this run (Step 5's one-outcome-per-signature rule).
323+
299324
Emit one `create_pull_request` using the Test-disable PR template. Diff <= 5 lines; only test annotations or csproj flags. Body MUST include `Linked KBE: #<n>` as a top-level line plus the Step 4.8 four-question block.
300325

301326
Build-break KBEs cannot be disabled — there is no test annotation that can skip a compile error. Skip Branch B for build-break signatures (record `skipped: build break — no test-disable path` in the tally) and rely on Branch C (small-fix PR) when the fix is mechanical, or on the area owner otherwise.

docs/coding-guidelines/code-formatting-tools.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ The following code block can be used as the contents of the `pre-commit` file to
8888

8989
```sh
9090
#!/bin/sh
91-
./eng/formatting/format.sh
9291

92+
./eng/formatting/format.sh
9393
```
94+
95+
Make sure the file is executable (`chmod +x .git/hooks/pre-commit`). If `git config core.hooksPath` points elsewhere, set it with `git config core.hooksPath .git/hooks`.

docs/coding-guidelines/interop-guidelines.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal static partial class Interop
3434
...
3535
internal static partial class Interop
3636
{
37-
internal static partial class mincore { ... }
37+
internal static partial class Mincore { ... }
3838
}
3939
```
4040
- With few exceptions, the only methods that should be defined in these interop types are DllImports.
@@ -49,7 +49,9 @@ internal static partial class Interop
4949
```
5050
\Common\src\Interop
5151
\Windows
52-
\mincore
52+
\Kernel32
53+
... interop files
54+
\Mincore
5355
... interop files
5456
\Unix
5557
\libc
@@ -71,8 +73,8 @@ As shown above, platforms may be additive, in that an assembly may use functiona
7173
\libc
7274
\Interop.strerror.cs
7375
\Windows
74-
\mincore
75-
\Interop.OutputDebugString.cs
76+
\Mincore
77+
\Interop.WaitOnAddress.cs <-- Also contains WakeByAddressSingle
7678
```
7779

7880
- If structs/constants will be used on their own without an associated DllImport, or if they may be used with multiple DllImports not in the same file, they should be declared in a separate file.
@@ -81,9 +83,9 @@ As shown above, platforms may be additive, in that an assembly may use functiona
8183
```
8284
\Common\src\Interop
8385
\Windows
84-
\mincore
85-
\Interop.DuplicateHandle_SafeTokenHandle.cs
86-
\Interop.DuplicateHandle_IntPtr.cs
86+
\Kernel32
87+
\Interop.DuplicateHandle_SafeFileHandle.cs
88+
\Interop.DuplicateHandle_SafePipeHandle.cs
8789
```
8890

8991
- The library names used per-platform are stored in internal constants in the Interop class in a private Libraries class in a per-platform file named Interop.Libraries.cs. These constants are then used for all DllImports to that library, rather than having the string duplicated each time, e.g.
@@ -94,12 +96,9 @@ internal static partial class Interop // contents of Common\src\Interop\Windows\
9496
private static class Libraries
9597
{
9698
internal const string Kernel32 = "kernel32.dll";
99+
internal const string OleAut32 = "oleaut32.dll";
97100
internal const string Localization = "api-ms-win-core-localization-l1-2-0.dll";
98-
internal const string Handle = "api-ms-win-core-handle-l1-1-0.dll";
99-
internal const string ProcessThreads = "api-ms-win-core-processthreads-l1-1-0.dll";
100-
internal const string File = "api-ms-win-core-file-l1-1-0.dll";
101-
internal const string NamedPipe = "api-ms-win-core-namedpipe-l1-1-0.dll";
102-
internal const string IO = "api-ms-win-core-io-l1-1-0.dll";
101+
internal const string Synch = "api-ms-win-core-synch-l1-2-0.dll";
103102
...
104103
}
105104
}

docs/design/coreclr/botr/readytorun-format.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,36 @@ which encodes an extra 4-byte representing the end RVA of the unwind info blob.
413413
| 4 | 4 | Unwind info end RVA (1 plus RVA of last byte)
414414
| 8 | 4 | GC info start RVA
415415

416+
### RUNTIME_FUNCTION (wasm, size = 8 bytes)
417+
418+
On WebAssembly, the `RUNTIME_FUNCTION` uses a virtual IP as the `BeginAddress` rather than an RVA
419+
into the image. The high bit of the `BeginAddress` field indicates whether the entry represents a
420+
funclet (1) or a main method body (0). The remaining 31 bits encode the virtual IP of the start of
421+
the function or funclet.
422+
423+
| Offset | Size | Value
424+
|-------:|-----:|:-----
425+
| 0 | 4 | Virtual IP (bits 30:0) &#124; IsFunclet flag (bit 31)
426+
| 4 | 4 | UnwindData RVA (GC info follows immediately after the unwind blob)
427+
428+
The table is terminated by a sentinel entry with all bits set (`0xFFFFFFFF`), followed by a 4-byte
429+
value containing the minimum WebAssembly function table index for the image.
430+
431+
### UnwindInfo (wasm)
432+
433+
On WebAssembly, the unwind info blob associated with each `RUNTIME_FUNCTION` entry is encoded as
434+
two consecutive ULEB128 values:
435+
436+
| Order | Encoding | Value
437+
|------:|:---------|:-----
438+
| 1 | ULEB128 | Frame size in bytes (the number of bytes to unwind from the stack)
439+
| 2 | ULEB128 | Virtual IP count divided by 2 (the number of virtual IPs logically present in the function, halved)
440+
441+
The virtual IP count (after multiplying by 2) gives the span of virtual IPs covered by this
442+
function or funclet. All virtual IPs are forced to even numbers so that the runtime can force all virtual
443+
ips to have odd numbers and fit into the address space in a manner which cannot conflict with either interpreter
444+
IPs or PortableEntryPoint structures.
445+
416446
## ReadyToRunSectionType.MethodDefEntryPoints
417447

418448
This section contains a native format sparse array (see 4 Native Format) that maps methoddef rows to

docs/design/datacontracts/GC.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@ public readonly struct GCOomData
130130
// describes a single segment with the inclusive start and exclusive end of its memory range
131131
// and its generation tag (or Ephemeral).
132132
IEnumerable<GCHeapSegmentInfo> EnumerateHeapSegments(GCHeapData heapData);
133+
134+
// Given the current probe address within a heap segment and the (aligned) size of the
135+
// object that lives at that address, returns the next candidate object address.
136+
// Implementations may consult cached per-target allocation-context state.
137+
TargetPointer GetPotentialNextObjectAddress(
138+
TargetPointer currentAddress,
139+
ulong currentObjectSize,
140+
GCHeapSegmentInfo segment);
141+
142+
// Aligns an object's raw size (base size + component bytes) to the alignment required by its containing segment
143+
ulong AlignObjectSize(ulong size, GCSegmentClassification generation);
133144
```
134145

135146
```csharp
@@ -306,12 +317,15 @@ Contracts used:
306317
| --- |
307318
| BuiltInCOM |
308319
| Object |
320+
| Thread |
309321

310322
Constants used:
311323
| Name | Type | Purpose | Value |
312324
| --- | --- | --- | --- |
313325
| `WRK_HEAP_COUNT` | uint | The number of heaps in the `workstation` GC type | `1` |
314326
| `HEAP_SEGMENT_FLAGS_READONLY` | ulong | `HeapSegment.Flags` bit identifying a readonly (e.g. frozen, non-GC) segment. | `1` |
327+
| `ALIGNCONST` | uint | Alignment mask for small object heaps | Target pointer size - 1 |
328+
| `ALIGNCONST_LARGE` | uint | Alignment mask for large/pinned object heaps | `7` |
315329

316330
```csharp
317331
GCHeapType IGC.GetGCIdentifiers()
@@ -1129,3 +1143,49 @@ IEnumerable<(HeapSegment Segment, TargetPointer Address)> WalkSegmentList(Target
11291143
}
11301144
}
11311145
```
1146+
1147+
GetPotentialNextObjectAddress
1148+
1149+
Computes the next candidate object address when walking a Gen0/Ephemeral segment.
1150+
Active allocation contexts (per-thread, the global non-thread-local context, and
1151+
the per-heap Gen0 context) carve out reserved-but-not-yet-allocated ranges inside
1152+
such segments; when the naive `current + size` lands on one of those ranges the
1153+
walk must skip past it. The contexts are collected via `IThread.GetThreadStoreData`
1154+
and `IThread.GetThreadData` (per-thread contexts), `IGC.GetGlobalAllocationContext`
1155+
(global context), and `IGC.GetGCIdentifiers` + `IGC.GetGCHeaps` + `IGC.GetHeapData`
1156+
(per-heap Gen0 contexts).
1157+
1158+
```csharp
1159+
TargetPointer IGC.GetPotentialNextObjectAddress(
1160+
TargetPointer currentAddress,
1161+
ulong currentObjectSize,
1162+
GCHeapSegmentInfo segment)
1163+
{
1164+
TargetPointer next = new TargetPointer(currentAddress.Value + currentObjectSize);
1165+
1166+
if (segment.Generation is not (GCSegmentClassification.Gen0 or GCSegmentClassification.Ephemeral))
1167+
return next;
1168+
1169+
ulong minObjSize = AlignForSmallObject((ulong)_target.PointerSize * 3);
1170+
foreach (/* context in allocation contexts */ )
1171+
{
1172+
if (next == /* context pointer */)
1173+
return new TargetPointer(/* context limit */ + minObjSize);
1174+
}
1175+
return next;
1176+
}
1177+
```
1178+
1179+
AlignObjectSize
1180+
1181+
Aligns a raw object size to the alignment required by its containing segment. SOH segments
1182+
use pointer-sized alignment; LOH/POH use 8-byte alignment.
1183+
1184+
```csharp
1185+
ulong IGC.AlignObjectSize(ulong size, GCSegmentClassification generation)
1186+
{
1187+
return generation is GCSegmentClassification.LOH or GCSegmentClassification.POH
1188+
? AlignForLargeObject(size) // (size + ALIGNCONST_LARGE) & ~ALIGNCONST_LARGE
1189+
: AlignForSmallObject(size); // (size + ALIGNCONST) & ~ALIGNCONST
1190+
}
1191+
```

0 commit comments

Comments
 (0)