Repository navigation
Conversation
Smaug123
marked this pull request as draft
November 25, 2026 19:09
Smaug123
force-pushed
the
issue-993-batch-model
branch
from
November 25, 2026 21:19
02daeec to
7eea07f
Compare
…#993, PR B) The walk follows MSBuild's batch of `Update`s (`LazyItemList.ComputeItems`) again, where PR A declined every `Update` that could leave it past its first fragment. Keys: `NormalizePathForComparisonNoThrow`, a spelling it refuses kept as written (`comparison_key`, which `Remove` and `Exclude` share), and under a non-ASCII project directory relative fragments keyed behind it (`batch_key`). Leaving removes earlier fragments by their text. Operations: one the walk certainly runs moves the batch as modelled; any other, a condition-false one included, is followed through both outcomes, since design-time evaluation batches a false `Update` that a build skips (probed, SDK 10.0.401). A bounded set of outcomes, past which, and past a fragment the walk cannot key or an inexact spec, every later `Update` is judged as in PR A. `update_batches_match_msbuild` holds commits to both MSBuild's build order and its design-time items, under ASCII and non-ASCII directories; the oracle's `itemsMeta` op gains `designTime`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A batch the walk follows moves from operation to operation; only a second outcome of an operation it may not run copies it, and every copy and key comparison is counted. - A strand across Updates names the fragment the Update leaves at, and a package strand is its own cause, StrandedUpdate, not a duplicate id. - The oracle's design-time items carry their escaped spelling. - The batch sweep lays its cases under an ASCII root wherever the checkout lies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An Update the walk may not run that, run, flushes a pending batch at its first fragment leaves the batch and an empty one, copying neither. - The batch sweep's coverage guard requires a case under each kind of directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An Update the walk may not run that, run, leaves a pending batch at any fragment flushes it: its outcomes are the batch and an empty one, found by a lookup per fragment and no copy. - The batch sweep's fallback case root is a fresh temporary directory of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Following an operation the walk may not run copies at most MAX_COPIED_KEYS keys; past that the walk follows no batch, so no input makes following one quadratic. - The batch sweep's fallback case root lies under an ASCII parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Following an operation the walk may not run copies, and compares, at most MAX_COPIED_BYTES bytes of keys as well as MAX_COPIED_KEYS keys; the cost counters count bytes too, and a long stranded key is pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - A fragment whose removal by text turns on how MaybeAdjustFilePath spells it from the working directory has no key: the batch is unknown past it. - A world is copied into a second outcome only while its table is small too, and a copy counts the table's capacity. - The batch model's certainty tests are Unix-only, as its keys are; off Unix a multi-fragment Update declines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - An element that may read an item list (@(Type)) may restart that type's batch: MSBuild computes the list there, once, and resumes past it with an empty batch; each batch gains that outcome. The batch sweep generates such a read. - Under MSBuild's case-sensitive item names escape hatch, each spelling of an item type has its own batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - An element may read an item list wherever a text of it, after expansion, may hold an item reference: a group gate, an item's attributes or a metadatum, any spacing, through a property the walk is not certain of (when some property text, environment or global value may form a reference), or an expression the walk cannot expand. Each such element adds the restarted (empty) outcome to every batch where MSBuild reaches it: the group gate before its children, each child of a walked or fed group before its operation, and the whole of a group the pass only judges. - Case-sensitive item names are out of the claim (#1162); the batch is keyed case-insensitively again. - The batch sweep generates reads through a property only where it writes one; the commit floor is the measured 1/25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - An element's texts are read as MSBuild reads them before they are searched for an item reference: attributes decoded and, as a metadatum's, read again as XML; bodies with their CDATA sections and comments. A text the walk cannot read counts as a possible read. - An expansion the walk is certain of is searched too: `$(At)(Compile)` with `At` holding `@` reads `@(Compile)`. - Property bodies are read the same way, once per file, with no recursion through nested `<Choose>` arms. - The batch sweep generates the new read spellings; its floor is the measured 1/30. Its certainty expectations are Unix's, where they depend on multi-fragment keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…PR B) - Whether a text may read an item list is held to a positive domain: no item reference, and either no `$`, an expansion the walk is certain of that holds none, or (no property value may hold one) a text that cannot form one around a value: no `@`, no `%`, every `$(` a plain property reference. A property body outside that last shape (a function, spaced or not) may hold one. - A metadatum body is read whole, mixed content included. - An attribute is decoded from the attribute in hand (`document::attribute_value`), so the scan does no search by name. - The batch sweep generates mixed-content and spaced-function reads; its fallback directory is the system's off Unix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Smaug123
force-pushed
the
issue-993-batch-model
branch
from
November 26, 2026 00:53
4eab5ab to
7b4a01a
Compare
…R B) - A text that reads a name the walk holds no value MSBuild may hold of (`MSBuildStartupDirectory` with no startup directory given) may read an item list, and so may any text once a property body reads such a name. - Whether a property value may hold an item reference is settled when the item pass starts, from the final table too: a value the walk seeds itself, or an environment or global value, holding an `@` or a `%`. That replaces the scan of environment and global values. - The property-body scan stops, conservatively, at MSBuild's own `<Choose>` nesting limit. - The generic sweep's floor off Unix is the one the walk held before it followed the batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - Environment and global values are scanned for a possible item reference again: a write may copy one before a later write replaces it, so the final table cannot answer for them. Each environment case of the test now has its own binding, so that none masks another. - A body is skipped only for a group by its place (under `Project` or a `<Choose>` arm), not for a metadatum named `ItemDefinitionGroup`. The batch sweep generates that metadatum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…PR B) Each file the walk enters rebinds `MSBuildThisFile*` to its own path, and a write there may copy one before the next file's rebinding, which the final table no longer shows. Entering a file whose path holds an `@` or a `%` marks property values as possibly holding an item reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - The read scan knows each element's role from the hook that hands it over, not from tag names: a group's gate, an item, and each metadatum of an item (whatever its name, `Project` and `ItemDefinitionGroup` included). A metadatum's body is read on its own, never as part of its item's serialised XML. - The batch sweep places a read between two `Update`s of a run, and the corners hold each such spelling to design-time MSBuild in the sequence where a restart strands a fragment; every corner is now graded in design-time evaluation too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - A spelling with a character `PathIsInvalid` names (`:`, `|`, a quote, ...) has no key, for `Remove`, `Exclude` and the batch alike: SDK 10.0.401 compares it as written and SDK 8.0.428 normalises it, so `a:b` and `./a:b` are two keys to one and one to the other. - Two outcomes are compared by walking the table of smaller capacity, which is the cost counted, so a table a rollback left sparse is not walked again on every comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - A `CompileOrder` whose escaped, untrimmed text differs from the value the walk reads (` CompileFirst `, `Compile%46irst`) declines: the SDK's order target buckets the text as written, so such an item is in no bucket and is not compiled. The batch model let a multi-file `Update` carrying one commit; an `Include` or one-file `Update` had the same defect. Corners hold both spellings to MSBuild. - The oracle's design-time `itemsMeta` returns escaped metadata, as the SDK's targets compare it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - The design-time order reads `FullPath` unescaped once, as the build's own is, while `CompileOrder` stays escaped for bucketing. - `an_item_list_read_between_updates_restarts_the_batch` forces each in-run read (a later item reads `@(Other);@(Project)`) and pins design-time MSBuild's order per spelling apart from the walk: six restart the batch, the metadatum of an item named `Project` does not. The walk declines all seven. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R B) - The pinned read test names files with `Path::file_name`, so a host's separators do not decide it. - The cases lie under a directory the walk keys (ASCII letters, digits and `/._-`), not merely an ASCII one, so a checkout under `/tmp/p|q` cannot change a corner's verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim. The batch of
Updates the walk follows is MSBuild's, by its keys and by its operations, in build evaluation and design-time evaluation alike.Keys
NormalizePathForComparisonNoThrow, comparedOrdinalIgnoreCase. That is a full path, or the spelling as written where the function refuses to normalise it (PathIsInvalid: a:,|, quote, and the like in the file name).RemoveandExcludeshare the key function (comparison_key).Updatethat leaves the batch removes its earlier fragments by their text. A fragment spelled as its own key leaves with it; any other stays stranded.batch_key).Operations
<Choose>arm, import.-getItemwith no target) batches a falseUpdate's fragments, and a build skips them.Committed domain.
CompileandPackageReferencelists where the walk follows the batch through everyUpdate, in at most four outcomes, plus PR A's shapes (anUpdatethat cannot leave past its first fragment), which need no batch.Declines. The batch becomes unknown at any of:
\or a run of separators;Past that point, each
Updateis judged as PR A judges it, and anUpdatethat may strand declines its list.Part of #993 (PR B). It stacks on #1137 (PR A), now merged.
Why both evaluation modes
Probed with SDK 10.0.401. Each row prints each
Compileitem with itsCompileOrder; the SDK's order target putsCompileFirstfirst.The two modes disagree wherever a condition-false
Updatejoins the batch. Following both outcomes, the walk commits only where they agree.an_update_leaving_batched_entries_marks_the_set_uncertain(main's test) therefore keeps its assertion for the false case. The case declines, and the design-time probe agrees with it. My earlier PR 5 draft had corrected it to the build's answer alone; that correction does not appear here.The corpus differential (
fsproj_msbuild_corpus_diff) grades design-time evaluation, and compile order is served from build evaluation. Because PR B's claim covers both modes, that differential grades the claim; this answers round-2 #6 of PR 5.What changes
item_spec:comparison_keykeys a spelling MSBuild refuses to normalise as written, but gives no key to one with a\or a run of separators (MaybeAdjustFilePathchanges those with the working directory).batch_keyadds the non-ASCII-directory keys.item_pass:BatchState: the outcomes the batch may be in, asUpdateBatchRuns, or unknown.feed_update_batchandfeed_worldmove the batch from operation to operation. They copy only into a second outcome, capped, and they compare outcomes by a digest first.feed_unwalked_group).reach_doubtedcovers doubted<ItemGroup>gates and replayed groups that were not reached for certain.PackageReferenceUncertaintyCauseKind::StrandedUpdate.StrandedUpdatePrefixnow names the fragment theUpdateleaves the batch at.tools/msbuild-condition-oracle:itemsMetatakesdesignTime.Tests
Restored certainty. The cases PR A declined now commit again:
compile_update_compile_order_scales_*tests are certain again;compile_update_compile_order_declines_a_stranded_prefixasserts again that the walk declines exactly where something is stranded;duplicate_identity_package_update_marks_the_set_uncertain'sDelta;Gammais certain;Updates corner are certain and graded against MSBuild;most_generated_cases_are_certainis back to its 55% floor: 119 of 200 commit.The sweep.
update_batches_match_msbuildgenerates runs ofUpdates with these dimensions:Updateand on its group: a gate MSBuild skips, one the walk cannot decide, one the walk takes on an untrusted or inexact read;:-bearing ones and one the walk cannot key;Every commit is held to MSBuild's build order and to the order of its design-time items. At 3,000 cases, 323 reach the oracle, with no divergence.
batch_cases_often_commitpins its fixed sample: 18 of 227 commit under an ASCII directory and 10 of 173 under the other.Unit tests. About 30, ported from the old keys and reach branches and probed against
dotnet msbuildwhere they assert an order.Cost tests. Counts, not timings:
updates_the_walk_runs_copy_no_batch;updates_the_walk_may_not_run_cost_the_batch_linearly, covering keys present, moving and rolled back, and pending batches left at any fragment;a_long_stranded_key_costs_the_batch_linearly.Mutation checks. Each guard was reverted, and the mutation confirmed applied.
\rule;Costs and gates
All run locally, because the build box is down:
fsproj_msbuild_corpus_diff(manifest unmoved),sdk_chain_decline_attribution, workspacecargo test, and the project-corpus gate (every manifest unmoved,restore_cone_censusincluded) are all green on 46c0377.borzoi-msbuildtests pass on e0ba6c9; CI runs the rest.Codex
Base
2085e71a1, five rounds:R4: empty stranding fragment.
R4: package strand reported as a duplicate id.
R3: design-time escaped identity.
R3: ASCII test root.
R3: coverage guard with no case of a class.
R3: fallback test directory not created exclusively.
R3: fallback parent may be non-ASCII.
There was no R1 in any round. Every finding is fixed, each with a test that fails without its fix; the test-harness R3s are the exception.
Rounds 1–5 found one stream: the cost of copying the batch into a second outcome. Round 4's fix closed it by structure, a cap on the keys and bytes any copy holds, past which the walk follows no batch. Round 5 extended the cap from keys to bytes.
Out of the domain, filed
Updatethe walk cannot expand declines (PR A's rule).Updates that write nothing captured decline.PackageReferencebatches.🤖 Generated with Claude Code