feat(render): Campaign V slice V10 — Vulkan becomes the default backend

THIS CUTOVER AWAITS THE USER'S VISUAL SIGN-OFF. It is not complete. Section 7
of the campaign plan names the V10 sign-off as the only required user stop
besides gate failures, and it has not been given. This commit flips the default
and runs the battery so that the sign-off has evidence in front of it.

ROLLBACK, one line: `git revert` of this commit. It restores the GL default,
the pre-V10 escape-hatch polarity and the gate scripts' inherited backend
together; nothing else has to move with it.

An unset, empty or unrecognised ACDREAM_RENDER_BACKEND now yields
RenderBackendKind.Vulkan. Only `gl` or `opengl`, case-insensitive, selects
OpenGL. The polarity of the typo case flipped with the default and on purpose:
before V10 an unrecognised token had to land on GL because Vulkan was dark and a
typo must never silently start a backend that cannot draw; after V10 it has to
land on Vulkan for the same reason read the other way, because GL is the backend
V11 deletes. `opengl` is honoured beside `gl` because an escape hatch exists to
be found.

Three gate scripts follow the flip. run-offline-pixel-gate.ps1 gains -Backend
(default vulkan) and now FORCES all four determinism levers — backend, day
group, world day fraction, sky phase — plus ACDREAM_MSAA_SAMPLES=0, instead of
inheriting any of them. run-repeat-connected-gate.ps1 and
run-connected-world-lifecycle-gate.ps1 CLEAR ACDREAM_RENDER_BACKEND rather than
setting it, so what they exercise is the process default and an ambient override
in a caller's shell cannot make a GL run wear the default's report.

TEST PIN UPDATED, flagged as required: RenderBackend_DefaultsToGl becomes
RenderBackend_DefaultsToVulkan, and RenderBackend_AnythingElseStaysOnGl splits
into RenderBackend_SelectsGlOnlyForTheEscapeHatchTokens and
RenderBackend_AnythingElseStaysOnVulkan. Five cases replace two. No other test
is touched, weakened or deleted.

AD-46's divergence-register row moves from "dormant until the V10 cutover" to
live, in this commit, per the same-commit register rule.

Battery, all on the new default:

  complete Release suite    9,222 passed / 5 skipped / 0 failed (9 projects)
                            +5 against the pre-flip 9,217; the +5 are this
                            slice's own escape-hatch cases
  #250 family, singly       4/4 pass (none failed in the whole-suite run)
  repeat connected gate     PASS 3/3 on both columns
  world-lifecycle route     PASS, 0 failures, both sessions graceful at exit 0
  validation layer          inserted at instance AND device level by the loader,
                            zero errors and zero warnings, real frame captured
  GL escape hatch           verified by two offline launches: 4.3.0 Core Profile
                            Context, bindless present, exit 0

Every connected launch in the battery reached Vulkan with no environment
variable set, which is the flip itself under test rather than an assertion
about it.

THE PIXEL GATE IS NOT MET, AND WAS NOT RELAXED. Vulkan against a GL-era capture
taken at this commit through the escape hatch, MSAA off and both clocks pinned:
1.099e-03 masked / 3.764e-02 whole-frame, against a 0.001 threshold. 97.9% of
the difference is in the treeline band, and the masked residual of 619 px — set
against a same-backend control of 10 px — sits entirely on the silhouettes of
distant alpha-blended scenery. That is AD-46's registered population; section
5.5.19 measured the same quantity at 497 px / 8.8e-04. Below the band the two
backends are photometrically identical: mean luminance differs by 0.01 of 255.
No baseline was regenerated and no mask or tolerance was widened.

Two instrument findings are recorded in section 5.5.23. The offline gate's sky
mask is still load-bearing — this slice tried retiring it on the reasoning that
V7's clock pins had made it obsolete, and the control refuted that: two launches
of the same binary still differ by 1,011 px on GL and 482 px on Vulkan, almost
all of it in the band. The default went back to 280 with the measurement written
into the script's help. And the repeat gate's desktop witness needs an
uncontested primary monitor: a first attempt reported 1/3, and the two failing
grabs turn out to be a web browser and Discord composited over the client rect,
not a blank frame — the client's Vulkan capture rendered in all six runs.

Nothing GL, ImGui or Studio is deleted. That is V11's scope and it is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-28 22:32:25 +02:00
parent 49a309aaaf
commit 122fe8a7e2
8 changed files with 315 additions and 41 deletions

View file

@ -3,10 +3,10 @@ namespace AcDream.App;
/// <summary>
/// Campaign V slice V5: which rendering backend the graphical host starts.
///
/// OpenGL is the default and, through slice V9, the only backend that renders
/// the game. <see cref="Vulkan"/> is dark bring-up — it creates an instance, a
/// device, a swapchain and runs the capability gate, and nothing more, until the
/// Vulkan RHI backend lands at V6.
/// Slice V10 flipped the default. <see cref="Vulkan"/> is what an unset
/// <c>ACDREAM_RENDER_BACKEND</c> now selects; <see cref="Gl"/> remains reachable
/// for one slice by setting that variable to <c>gl</c>, and slice V11 deletes it
/// along with the escape hatch.
///
/// This enum is public only because <see cref="RuntimeOptions"/> is public and
/// exposes it as a property. The backend-neutral
@ -17,9 +17,12 @@ namespace AcDream.App;
/// </summary>
public enum RenderBackendKind
{
/// <summary>OpenGL 4.3 core + bindless + MDI. The default, and the only live backend.</summary>
/// <summary>
/// OpenGL 4.3 core + bindless + MDI. The escape hatch after slice V10,
/// reachable only by <c>ACDREAM_RENDER_BACKEND=gl</c>, deleted at V11.
/// </summary>
Gl,
/// <summary>Vulkan 1.3 core. Dark until Campaign V slice V10 flips the default.</summary>
/// <summary>Vulkan 1.3 core. The default backend as of Campaign V slice V10.</summary>
Vulkan,
}

View file

@ -147,8 +147,9 @@ public sealed record RuntimeOptions(
FogEndMultiplier: TryParseFloat(env("ACDREAM_FOG_END_MULT")) ?? 0.95f,
ResidencyBudgets: ResidencyBudgetOptions.Parse(env),
StreamingWorkBudgets: StreamingWorkBudgetOptions.Parse(env),
// Campaign V slice V5. Unset, empty, or any unrecognised value means
// OpenGL: a typo must never silently start the dark Vulkan host.
// Campaign V slice V10 flipped this. Unset, empty, or any
// unrecognised value now means Vulkan: it is the shipping backend,
// and a typo must never silently start the backend V11 deletes.
RenderBackend: ParseRenderBackend(env("ACDREAM_RENDER_BACKEND")),
// Physical-device override, matched as a decimal index first and then
// as a case-insensitive device-name substring. Recorded verbatim in
@ -178,14 +179,27 @@ public sealed record RuntimeOptions(
}
/// <summary>
/// Startup backend request. Only the exact lower-case token <c>vulkan</c>
/// selects Vulkan; everything else — unset, <c>gl</c>, or a typo — is
/// OpenGL, which is the shipping backend until Campaign V slice V10.
/// Startup backend request. Campaign V slice V10 inverted this: Vulkan is
/// the default, and only the explicit escape-hatch tokens <c>gl</c> and
/// <c>opengl</c> select OpenGL. Everything else — unset, <c>vulkan</c>, or a
/// typo — is Vulkan.
/// </summary>
/// <remarks>
/// The polarity of the typo case is deliberate and it flipped with the
/// default. Before V10 an unrecognised token had to land on GL, because
/// Vulkan was dark and a typo must never silently start a backend that
/// cannot draw. After V10 an unrecognised token must land on Vulkan for the
/// same reason read the other way: GL is the retiring backend that slice V11
/// deletes, so a typo must never silently pin a process to it. <c>opengl</c>
/// is honoured alongside <c>gl</c> because the escape hatch exists to be
/// found, and the failure mode of a near-miss spelling here is a process
/// that quietly is not on the backend the operator asked to fall back to.
/// </remarks>
private static RenderBackendKind ParseRenderBackend(string? value)
=> string.Equals(value, "vulkan", StringComparison.OrdinalIgnoreCase)
? RenderBackendKind.Vulkan
: RenderBackendKind.Gl;
=> string.Equals(value, "gl", StringComparison.OrdinalIgnoreCase)
|| string.Equals(value, "opengl", StringComparison.OrdinalIgnoreCase)
? RenderBackendKind.Gl
: RenderBackendKind.Vulkan;
/// <summary>True iff live-mode credentials are present and valid for connecting.</summary>
public bool HasLiveCredentials =>