Skip to content

Commit 6172ac8

Browse files
pavelsavaraCopilot
andcommitted
Merge main into render batch frame-copy optimization
Preserve main's fixed-record serialization and production benchmarks while retaining direct frame references and the source-array correctness tests. Replace the obsolete copied-writer benchmark and remove its unused references and friend-assembly access. Co-authored-by: Copilot <[email protected]>
2 parents f42f30c + d50a9ba commit 6172ac8

42 files changed

Lines changed: 2938 additions & 942 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"dotnet-ef": {
12-
"version": "12.0.0-alpha.1.26528.111",
12+
"version": "12.0.0-alpha.1.26530.111",
1313
"commands": [
1414
"dotnet-ef"
1515
]
@@ -27,7 +27,7 @@
2727
]
2828
},
2929
"microsoft.dotnet.helix.jobmonitor": {
30-
"version": "12.0.0-beta.26528.111",
30+
"version": "12.0.0-beta.26530.111",
3131
"commands": [
3232
"dotnet-helix-job-monitor"
3333
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Internal per-guide worker for review-pull-request; not for direct use. Reviews one routed ASP.NET Core guide using only frozen source and assigned guidance
3+
tools: ["read", "search", "skill"]
4+
strict-tools-list: true
5+
user-invocable: false
6+
---
7+
Your first native tool call must be `skill(skill="review-pull-request")`. Follow the
8+
per-guide assignment and the loaded skill's `PATH: per-guide-worker` contract exactly.
9+
Read only the assigned frozen bundle paths and source roots. Return candidates to the
10+
coordinator; do not aggregate guides or publish. Shell execution, file mutation, safe
11+
outputs, web access, and further agent delegation are unavailable by design.

‎.github/skills/review-pull-request/SKILL.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,20 @@ its call edge; an unsupported hypothetical is not an incomplete material claim.
133133

134134
## Review and independent validation
135135

136-
Launch exactly one fresh reviewer worker per routed guide as a full-capability
137-
`general-purpose` agent, never an explore, fast, or other lightweight agent. Select the
136+
Launch exactly one fresh reviewer worker per routed guide as the native
137+
`review-guide-worker` custom agent, never a built-in `general-purpose`, explore, fast,
138+
or other agent. Its native profile must expose only `read`, `search`, and `skill`; a
139+
missing profile or any additional worker tool makes that guide `incomplete`. Select the
138140
caller-supplied worker model, or `gpt-5.6-sol` when the caller omitted it; pass that model
139141
explicitly and independently to every worker, never inheriting the coordinator or
140142
session model. Pass the caller-supplied reasoning effort explicitly and independently
141143
to every worker; when omitted, omit the effort setting and record
142144
`not supplied (runtime default)`. Use `mode: "background"` so the same worker can receive
143-
follow-ups through `write_agent`. Wait for its completion notification, then collect the
144-
actual report with `read_agent` using `wait: true`; after each same-worker clarification,
145-
wait and collect its completed follow-up the same way before synthesis. Record each
145+
follow-ups through `write_agent`. After the `task` calls return, stay in your turn and
146+
collect each worker's actual report with `read_agent` using `wait: true` (repeating on
147+
timeout if needed) rather than ending your response to wait for a completion
148+
notification; after each same-worker clarification, collect its completed follow-up the
149+
same way before synthesis. Record each
146150
requested agent type, model, and effort plus any runtime-reported values; record missing
147151
runtime telemetry as `unknown`, which alone does not make a guide incomplete. A confirmed
148152
mismatch, runtime rejection, or inability to apply an explicitly requested setting makes

‎.github/skills/review-pull-request/scripts/Directory.Build.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<NoWarn>$(NoWarn);IL2026;IL3050;NU1507</NoWarn>
55
<PublishAot>false</PublishAot>
66
<PublishTrimmed>false</PublishTrimmed>
7-
<UseAppHost>false</UseAppHost>
7+
<UseAppHost Condition="'$(FileBasedProgram)' == 'true'">false</UseAppHost>
88
</PropertyGroup>
99
</Project>

‎.github/skills/review-pull-request/scripts/PrepareReview.Tests.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net11.0</TargetFramework>
3+
<TargetFramework>$(BundledNETCoreAppTargetFramework)</TargetFramework>
44
<LangVersion>13</LangVersion>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>

‎.github/skills/review-pull-request/scripts/prepare-review.cs‎

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ internal sealed record Options(
4242
string? Hostname = null,
4343
string? Guidance = null,
4444
string? GuidanceRoot = null,
45-
bool Check = false);
45+
bool Check = false,
46+
string? BaseTip = null,
47+
string? MergeBase = null,
48+
string? BaseRef = null);
4649

4750
internal sealed record Dependencies(
4851
Func<string, string?, Task<JsonNode?>>? Api = null,
@@ -98,6 +101,7 @@ internal static async Task<int> RunAsync(string[] args, Dependencies? dependenci
98101
private static Options ParseArguments(string[] args)
99102
{
100103
string? repo = null, pr = null, output = null, head = null, hostname = null, guidance = null, guidanceRoot = null;
104+
string? baseTip = null, mergeBase = null, baseRef = null;
101105
var check = false;
102106
for (var index = 0; index < args.Length; index++)
103107
{
@@ -107,7 +111,7 @@ private static Options ParseArguments(string[] args)
107111
check = true;
108112
continue;
109113
}
110-
Require(name is "--repo" or "--pr" or "--output" or "--head" or "--hostname" or "--guidance" or "--guidance-root"
114+
Require(name is "--repo" or "--pr" or "--output" or "--head" or "--hostname" or "--guidance" or "--guidance-root" or "--base-tip" or "--merge-base" or "--base-ref"
111115
&& index + 1 < args.Length, $"Unknown or incomplete option: {name}");
112116
var value = args[++index];
113117
switch (name)
@@ -119,13 +123,38 @@ private static Options ParseArguments(string[] args)
119123
case "--hostname": hostname = value; break;
120124
case "--guidance": guidance = value; break;
121125
case "--guidance-root": guidanceRoot = value; break;
126+
case "--base-tip": baseTip = value; break;
127+
case "--merge-base": mergeBase = value; break;
128+
case "--base-ref": baseRef = value; break;
122129
}
123130
}
124-
return new(repo, pr, output ?? string.Empty, head, hostname, guidance, guidanceRoot, check);
131+
return new(repo, pr, output ?? string.Empty, head, hostname, guidance, guidanceRoot, check, baseTip, mergeBase, baseRef);
125132
}
126133

127134
internal static string[] GitArguments(params string[] args) => ["-c", "core.longpaths=true", .. args];
128135

136+
internal static byte[] ExpandBinaryIndexLines(byte[] diff, IReadOnlySet<string> knownIds)
137+
{
138+
return Encoding.Latin1.GetBytes(BinaryIndexLine().Replace(Encoding.Latin1.GetString(diff), match =>
139+
$"index {Expand(match.Groups[1].Value)}..{Expand(match.Groups[2].Value)}{match.Groups[3].Value}{match.Groups[4].Value}"));
140+
141+
string Expand(string prefix)
142+
{
143+
if (prefix.Length == 40)
144+
{
145+
return prefix;
146+
}
147+
if (prefix.All(character => character == '0'))
148+
{
149+
return new string('0', 40);
150+
}
151+
var matches = knownIds.Where(id => id.StartsWith(prefix, StringComparison.Ordinal)).Take(2).ToArray();
152+
Require(matches.Length == 1,
153+
$"The authoritative binary diff has an {(matches.Length == 0 ? "unknown" : "ambiguous")} object prefix: {prefix}");
154+
return matches[0];
155+
}
156+
}
157+
129158
private static byte[] Git(string directory, params string[] args) =>
130159
Run("git", GitArguments(["-C", directory, .. args]));
131160

@@ -1297,6 +1326,11 @@ async Task<T> Timed<T>(string name, Func<Task<T>> action)
12971326
"Cannot resolve a single target repository; specify --repo OWNER/REPO and --pr NUMBER.");
12981327
Require(options.Output.Length > 0, "Specify a new --output directory, or --check an existing prepared directory.");
12991328
Require(options.Head is null || FullShaRegex().IsMatch(options.Head), "--head must be a full immutable commit.");
1329+
Require(options.BaseTip is null && options.MergeBase is null && options.BaseRef is null
1330+
|| options.Head is not null && options.BaseTip is not null && FullShaRegex().IsMatch(options.BaseTip)
1331+
&& options.MergeBase is not null && FullShaRegex().IsMatch(options.MergeBase)
1332+
&& !string.IsNullOrEmpty(options.BaseRef),
1333+
"A frozen base requires --head, --base-tip, --merge-base, and --base-ref with full immutable commits.");
13001334
Require(options.Guidance is null || options.GuidanceRoot is null, "Select either --guidance or --guidance-root.");
13011335
var producer = ProducerHash(dependencies.ProducerSourcePath);
13021336
var host = options.Hostname ?? "github.com";
@@ -1334,14 +1368,21 @@ async Task<T> Timed<T>(string name, Func<Task<T>> action)
13341368
var head = pull["head"]!["sha"]!.GetValue<string>();
13351369
Require(options.Head is null || options.Head == head, "The live PR head differs from the expected frozen head.");
13361370
var baseRef = pull["base"]!["ref"]!.GetValue<string>();
1337-
var encodedRef = Uri.EscapeDataString(baseRef);
1338-
var branch = (await Api($"{endpoint}/git/ref/heads/{encodedRef}"))!.AsObject();
1339-
var baseTip = branch["object"]?["sha"]?.GetValue<string>() ?? "";
1371+
Require(options.BaseRef is null || options.BaseRef == baseRef, "The live PR base ref differs from the expected frozen base.");
1372+
var baseTip = options.BaseTip ?? "";
1373+
if (options.BaseTip is null)
1374+
{
1375+
var encodedRef = Uri.EscapeDataString(baseRef);
1376+
var branch = (await Api($"{endpoint}/git/ref/heads/{encodedRef}"))!.AsObject();
1377+
baseTip = branch["object"]?["sha"]?.GetValue<string>() ?? "";
1378+
}
13401379
Require(FullShaRegex().IsMatch(baseTip), "The base branch did not resolve to a full commit.");
13411380
var comparison = (await Api($"{endpoint}/compare/{baseTip}...{head}"))!.AsObject();
13421381
var mergeBase = comparison["merge_base_commit"]?["sha"]?.GetValue<string>() ?? "";
13431382
Require(comparison["base_commit"]?["sha"]?.GetValue<string>() == baseTip && FullShaRegex().IsMatch(mergeBase),
13441383
"GitHub did not return the expected immutable comparison identities.");
1384+
Require(options.MergeBase is null || options.MergeBase == mergeBase,
1385+
"The comparison differs from the expected frozen merge base.");
13451386
return (new JsonObject
13461387
{
13471388
["hostname"] = host,
@@ -1480,7 +1521,13 @@ await Timed("diff", async () =>
14801521
Objects(store, "read-tree", frozen.Identity["mergeBase"]!.GetValue<string>());
14811522
if (diff.Length > 0)
14821523
{
1483-
Objects(store, "apply", "--cached", "--binary", "--whitespace=nowarn", Path.Combine(output, "diff.patch"));
1524+
// REST omits binary payloads; resolve its prefixes against the frozen changed objects, not supplied bytes.
1525+
var knownIds = Utf8NoBom.GetString(Objects(store, "diff", "--raw", "--no-abbrev", "-z", "--no-renames",
1526+
"--no-ext-diff", "--no-textconv", frozen.Identity["mergeBase"]!.GetValue<string>(), frozen.Identity["head"]!.GetValue<string>()))
1527+
.Split('\0').Where((_, index) => index % 2 == 0)
1528+
.SelectMany(entry => entry.Split(' ').Skip(2).Take(2)).ToHashSet(StringComparer.Ordinal);
1529+
Run("git", GitArguments(["--git-dir", store, "apply", "--cached", "--binary", "--whitespace=nowarn", "-"]),
1530+
input: ExpandBinaryIndexLines(diff, knownIds));
14841531
}
14851532
Require(Utf8NoBom.GetString(Objects(store, "write-tree")).Trim()
14861533
== Utf8NoBom.GetString(Objects(store, "rev-parse", $"{frozen.Identity["head"]!.GetValue<string>()}^{{tree}}")).Trim(),
@@ -2195,6 +2242,8 @@ private static bool TryJsonSafeInteger(JsonNode? value, out long result)
21952242
return true;
21962243
}
21972244

2245+
[GeneratedRegex("^index ([a-f0-9]{4,40})\\.\\.([a-f0-9]{4,40})( [0-7]{6})?(\\r?\\n)(?=Binary files [^\\r\\n]* differ(?:\\r?\\n|$))", RegexOptions.Multiline | RegexOptions.CultureInvariant)]
2246+
private static partial Regex BinaryIndexLine();
21982247
[GeneratedRegex("^[a-f0-9]{40}$", RegexOptions.CultureInvariant)]
21992248
private static partial Regex FullShaRegex();
22002249
[GeneratedRegex("^[a-z0-9_.-]+/[a-z0-9_.-]+$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)]

0 commit comments

Comments
 (0)