Skip to content

Commit 2806695

Browse files
authored
Merge branch 'main' into fix-memory-leak-in-aot-compiler
2 parents 12ec34b + b01c08c commit 2806695

2,409 files changed

Lines changed: 109754 additions & 39012 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.

.claude/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extraKnownMarketplaces": {
3+
"dotnet-arcade-skills": {
4+
"source": {
5+
"source": "github",
6+
"repo": "dotnet/arcade-skills"
7+
}
8+
}
9+
},
10+
"enabledPlugins": {
11+
"dotnet-dnceng@dotnet-arcade-skills": true
12+
}
13+
}

.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.26174.1",
18+
"version": "11.0.0-prerelease.26204.1",
1919
"commands": [
2020
"xharness"
2121
]

.github/agents/agentic-workflows.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
name: agentic-workflows
23
description: GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing
34
disable-model-invocation: true
45
---

.github/agents/extensions-reviewer.md

Lines changed: 245 additions & 0 deletions
Large diffs are not rendered by default.

.github/agents/system-net-review.md

Lines changed: 427 additions & 0 deletions
Large diffs are not rendered by default.

.github/aw/actions-lock.json

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,20 @@
55
"version": "v8",
66
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
77
},
8+
"actions/github-script@v9": {
9+
"repo": "actions/github-script",
10+
"version": "v9",
11+
"sha": "373c709c69115d41ff229c7e5df9f8788daa9553"
12+
},
813
"actions/upload-artifact@v4": {
914
"repo": "actions/upload-artifact",
1015
"version": "v4",
1116
"sha": "ea165f8d65b6e75b540449e92b4886f43607fa02"
1217
},
13-
"github/gh-aw-actions/setup@v0.63.0": {
14-
"repo": "github/gh-aw-actions/setup",
15-
"version": "v0.63.0",
16-
"sha": "9128d2542bbf1bdfec94dabeaf3e1d3c0d402577"
17-
},
18-
"github/gh-aw-actions/setup@v0.63.1": {
19-
"repo": "github/gh-aw-actions/setup",
20-
"version": "v0.63.1",
21-
"sha": "53e09ec0be6271e81a69f51ef93f37212c8834b0"
22-
},
23-
"github/gh-aw-actions/setup@v0.64.5": {
24-
"repo": "github/gh-aw-actions/setup",
25-
"version": "v0.64.5",
26-
"sha": "5d2ebfd87a1a45a8a8323c1a12c01b055730dac5"
27-
},
28-
"github/gh-aw-actions/setup@v0.65.6": {
18+
"github/gh-aw-actions/setup@v0.68.1": {
2919
"repo": "github/gh-aw-actions/setup",
30-
"version": "v0.65.6",
31-
"sha": "31130b20a8fd3ef263acbe2091267c0aace07e09"
20+
"version": "v0.68.1",
21+
"sha": "2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc"
3222
}
3323
}
3424
}

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Based on file paths you will modify:
8484

8585
### Step 2: Run the Baseline Build (from repo root)
8686

87-
**First, checkout the `main` branch** to establish a known-good baseline, then run the appropriate build command:
87+
From the repo root, on the branch you intend to modify, ensure you have a clean working tree (no uncommitted changes) at the current HEAD, then run the appropriate build command **before making any code changes**:
8888

8989
| Component | Command |
9090
|-----------|---------|
@@ -108,7 +108,7 @@ export PATH="$(pwd)/.dotnet:$PATH"
108108
dotnet --version # Should match sdk.version in global.json
109109
```
110110

111-
**Only proceed with changes after the baseline build succeeds.** If it fails, report the failure and stop. After the baseline build, switch back to your working branch before making changes.
111+
**Only proceed with changes after the baseline build succeeds.** If it fails, report the failure and stop.
112112

113113
---
114114

.github/copilot/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extraKnownMarketplaces": {
3+
"dotnet-arcade-skills": {
4+
"source": {
5+
"source": "github",
6+
"repo": "dotnet/arcade-skills"
7+
}
8+
}
9+
},
10+
"enabledPlugins": {
11+
"dotnet-dnceng@dotnet-arcade-skills": true
12+
}
13+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
applyTo: "src/libraries/System.IO.Compression*/**"
3+
---
4+
5+
# System.IO.Compression — Folder-Specific Guidance
6+
7+
## Format Specification Correctness (D12)
8+
9+
- ZIP64 extensions must be used for files over 4GB — extra field sizes, offsets, and header values must use 64-bit fields when the 32-bit range is exceeded
10+
- Compression levels must align with native library semantics — verify enum-to-native mapping is correct
11+
- New compression format support (e.g., zstd in ZIP) must include a feature switch for trimming/AOT and an explicit opt-in mechanism
12+
- Decompression must handle concatenated payloads and partial reads — the decompressor must not assume a single contiguous compressed stream
13+
- Breaking changes to format handling must be documented and include migration guidance
14+
15+
## Security
16+
17+
- Maximum decompressed size limits must be configurable to prevent zip-bomb attacks, following the existing deflate size limit pattern
18+
- Archive extraction must validate entry paths to prevent path traversal attacks (entries with `../` segments)
19+
20+
## Performance & Allocation (D5)
21+
22+
- Use `ArrayPool<byte>` for variable-size compression/decompression buffers — return buffers in finally blocks
23+
- Avoid allocating excessively large fixed buffers per operation (100KB+ per compression operation is expensive)
24+
- Pin buffers for the duration of native I/O operations
25+
- Hot paths must avoid per-operation allocations — prefer pooled buffers and cached delegates
26+
- Closures that capture state on hot paths must be eliminated — use static lambdas with explicit state
27+
28+
## Async Operations
29+
30+
- Async compression/decompression must not perform the actual compression work synchronously before the first await
31+
- Sync and async code paths must share non-trivial logic through common helpers to prevent divergence
32+
33+
## Cross-Platform Metadata (D19)
34+
35+
- Archive extraction must preserve or correctly translate platform-specific metadata — Unix execute permissions, symlinks, and hidden file attributes
36+
- File path operations within archives must use forward slashes as the archive-internal separator per the ZIP specification
37+
- Tests must verify metadata round-trip on both Windows and Unix platforms
38+
39+
## Native Interop
40+
41+
- Native library updates (brotli, zlib, zstd) must be tracked and the managed wrapper updated accordingly
42+
- Use `LibraryImport` (source-generated) for new P/Invoke declarations
43+
- SafeHandle-derived types must be used for native compression handles — never store raw IntPtr
44+
- Native error codes must be mapped to appropriate .NET exceptions with the native error code preserved
45+
46+
## Error Handling (D9)
47+
48+
- Exceptions must be the most specific applicable type — `InvalidDataException` for corrupt archives, `IOException` for I/O failures, with actionable context (entry name, expected vs actual values)
49+
- Operations on streams that may not support Length/Seek must be guarded appropriately
50+
51+
## Interoperability Testing (D10)
52+
53+
- Tests must use archive files created by external tools — not just round-trip tests with the same .NET implementation
54+
- Test with archives from multiple platforms and compression libraries to verify cross-tool compatibility
55+
- Cover edge cases: empty archives, many small entries, entries at size boundaries (4GB, uint.MaxValue)
56+
- Dispose behavior must be tested — verify resources are released and post-disposal operations throw
57+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
applyTo: "src/libraries/Microsoft.Extensions.Caching*/**"
3+
---
4+
5+
# Microsoft.Extensions.Caching — Folder-Specific Guidance
6+
7+
## Cache Key Correctness (D20)
8+
9+
- Cache keys must incorporate all inputs that affect the cached result — including format versions, serialization options, and any parameters that change the output
10+
- Key generation must be deterministic and stable across process restarts for distributed caches
11+
- Verify that key composition does not create collisions for distinct inputs
12+
- Cache miss must be distinguishable from a cached null value
13+
14+
## Eviction Policies (D20)
15+
16+
- Cache eviction must consider TTL, priority, estimated object size, and memory pressure — not just LRU
17+
- Expose eviction callbacks so consumers can observe and react to entry removal
18+
- Memory pressure-based eviction should clear stale references to avoid retaining unused objects
19+
20+
## Stampede Prevention (D20)
21+
22+
- When a cache entry expires, only one caller should recompute the value while others wait (thundering herd mitigation)
23+
- HybridCache (available in .NET 9+) and similar patterns should use a single-flight mechanism for concurrent requests to the same key
24+
25+
## Performance & Allocation (D5)
26+
27+
- Closures for cache factory methods must not allocate on every cache access — cache the delegate or use a static lambda with explicit state
28+
- Distributed cache serialization must handle large objects efficiently — consider compression and streaming for values over 100KB
29+
- In-memory cache operations must avoid holding locks during expensive value computation
30+
- Hot paths must avoid per-operation allocations — prefer pooled buffers and cached delegates
31+
32+
## Thread Safety (D6)
33+
34+
- `MemoryCache` and `HybridCache` (available in .NET 9+) are expected to be used concurrently — all access patterns must be thread-safe
35+
- Entry creation and eviction callbacks may execute on different threads — do not assume single-threaded access
36+
37+
## Distributed vs In-Memory
38+
39+
- `IDistributedCache` implementations must handle serialization/deserialization correctly and document size limits
40+
- Test with both in-memory and distributed backing stores — behavior differences must be accounted for
41+
- Distributed cache key expiration semantics may differ from in-memory — document and test accordingly
42+

0 commit comments

Comments
 (0)