From 81fb30e8c3458d8946c30d4bfdf61603d5d29c69 Mon Sep 17 00:00:00 2001 From: Noah Falk Date: Fri, 21 Aug 2026 02:24:37 -0700 Subject: [PATCH] Remove cDAC fallback testing mode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/diagnostics/sos-test-leg.yml | 2 +- eng/pipelines/runtime-diagnostics.yml | 13 ++++--------- .../LegacyFallbackHelper.cs | 13 +++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/eng/pipelines/diagnostics/sos-test-leg.yml b/eng/pipelines/diagnostics/sos-test-leg.yml index 6886b47aa3251d..31b37668926de1 100644 --- a/eng/pipelines/diagnostics/sos-test-leg.yml +++ b/eng/pipelines/diagnostics/sos-test-leg.yml @@ -1,6 +1,6 @@ # sos-test-leg.yml -- wraps the matrix + job + dep + artifact download + # standard postBuildSteps pattern used by the SOS-style test legs (cDAC, -# cDAC_fallback, cDAC_verify, DAC) that run on windows_x64. Each of those legs +# cDAC_verify, DAC) that run on windows_x64. Each of those legs # only differs in its `name` and `dacMode` value. # # AzDO tasks workaround: diff --git a/eng/pipelines/runtime-diagnostics.yml b/eng/pipelines/runtime-diagnostics.yml index 44a6f49bbcdaed..6abfcd5444444b 100644 --- a/eng/pipelines/runtime-diagnostics.yml +++ b/eng/pipelines/runtime-diagnostics.yml @@ -3,8 +3,8 @@ # Pipeline overview: # # SOSTests windows_x64 Release. One shared coreclr+libs build (-c Debug -# -rc release -lc release -clrinterpreter) consumed by 4 SOS -# legs that run on top of it: cDAC, cDAC_fallback, cDAC_verify, DAC. +# -rc release -lc release -clrinterpreter) consumed by 3 SOS +# legs that run on top of it: cDAC, cDAC_verify, DAC. # Each leg sets testInterpreter: true so interpreter coverage # is exercised inline (no separate Interpreter leg). # @@ -177,13 +177,8 @@ extends: name: cDAC dacMode: cdac - # cDAC_fallback / cDAC_verify: the in-box DAC hosts the cDAC contract reader, with per-API fallback - # to the legacy DAC (fallback) or no fallback but still verifying against it (verify). - - template: /eng/pipelines/diagnostics/sos-test-leg.yml - parameters: - name: cDAC_fallback - dacMode: cdacfallback - + # cDAC_verify: the in-box DAC hosts the cDAC contract reader without fallback, + # while still verifying against the legacy DAC. - template: /eng/pipelines/diagnostics/sos-test-leg.yml parameters: name: cDAC_verify diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs index 057cdd4a742dc7..2dc2862d6a6236 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs @@ -11,15 +11,12 @@ namespace Microsoft.Diagnostics.DataContractReader.Legacy; /// /// Controls whether delegation-only APIs can fall back to the legacy DAC implementation. -/// When CDAC_NO_FALLBACK=1 is set, only explicitly allowlisted methods may delegate. +/// Only explicitly allowlisted methods may delegate. /// All fallback attempts are logged to stderr for capture by the test infrastructure. /// internal static class LegacyFallbackHelper { - private static readonly bool s_noFallback = - Environment.GetEnvironmentVariable("CDAC_NO_FALLBACK") == "1"; - - // Methods that are allowed to fall back even in no-fallback mode. + // Methods that are allowed to fall back. // Use the method name as it appears via [CallerMemberName]. private static readonly HashSet s_allowlist = new(StringComparer.Ordinal) { @@ -36,8 +33,7 @@ internal static class LegacyFallbackHelper /// /// Returns true if the calling method is allowed to delegate to the legacy DAC. - /// In normal mode (no CDAC_NO_FALLBACK), always returns true. - /// In no-fallback mode, returns true only for allowlisted methods. + /// Returns true only for allowlisted methods. /// All fallback attempts (allowed and blocked) are logged to stderr. /// internal static bool CanFallback( @@ -45,9 +41,6 @@ internal static bool CanFallback( [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { - if (!s_noFallback) - return true; - if (s_allowlist.Contains(name) || s_fileAllowlist.Contains(Path.GetFileName(file))) { Console.Error.WriteLine($"[cDAC] Allowed fallback: {name} at {Path.GetFileName(file)}:{line}");