From 23343388d386f2110f06a133cf07006043bb83b4 Mon Sep 17 00:00:00 2001 From: deepanshu Date: Mon, 9 Nov 2026 14:20:43 +0530 Subject: [PATCH 1/6] Log SPECcpu NumaProcessorAffinity metadata as core ranges Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs index ed8d029298..c3a653f551 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs @@ -267,7 +267,8 @@ protected async Task ExecuteSpecCpuAsync(EventContext telemetryContext, Cancella this.Parameters[nameof(this.EnableNumaProcessorAffinitySymmetric)] = true; string affinity = await this.GetSymmetricNumaProcessorAffinityAsync(cancellationToken); this.Parameters[nameof(this.NumaProcessorAffinity)] = affinity; - this.MetadataContract.Add(nameof(this.NumaProcessorAffinity), affinity, MetadataContract.ScenarioCategory); + string affinityRanges = new LinuxProcessAffinityConfiguration(ProcessAffinityConfiguration.ParseCoreList(affinity)).NumactlCoreSpec; + this.MetadataContract.Add(nameof(this.NumaProcessorAffinity), affinityRanges, MetadataContract.ScenarioCategory); this.MetadataContract.Apply(telemetryContext); this.LogSpecCpuStep(telemetryContext, "SymmetricAffinitySelected", ("cpuIds", affinity)); } From 7215f02dd4d51fb60f102b7047ea1c1bdd15faa3 Mon Sep 17 00:00:00 2001 From: deepanshu Date: Mon, 9 Nov 2026 15:04:16 +0530 Subject: [PATCH 2/6] Update SPECcpu symmetric affinity test to expect core-range metadata Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPEC/SpecCpu2017ExecutorTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs index f33e5e09e4..a3e77a60fa 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs @@ -699,7 +699,7 @@ public async Task SpecCpu2017ExecutorSelectsSymmetricNumaAffinity(int nodeCount, EventContext selection = (EventContext)this.mockFixture.Logger.Single(entry => entry.Item2.Name.EndsWith(".SymmetricAffinitySelected", StringComparison.Ordinal)).Item3; Assert.AreEqual(expectedCpus, selection.Properties["cpuIds"]); Assert.AreEqual(true, selection.Properties["pinningEnabled"]); - Assert.AreEqual(expectedCpus, ((IDictionary)selection.Properties["metadata_scenario"])["NumaProcessorAffinity"]); + Assert.AreEqual(expectedCoreSpec, ((IDictionary)selection.Properties["metadata_scenario"])["NumaProcessorAffinity"]); } [Test] From 2a0d47ff4db480ac80548c704e2c2213d8a90ef7 Mon Sep 17 00:00:00 2001 From: Deepanshu Vaid Date: Thu, 12 Nov 2026 14:24:12 +0530 Subject: [PATCH 3/6] Add SPECcpu symmetric affinity test for bifurcated NUMA node CPU ranges Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPEC/SpecCpu2017ExecutorTests.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs index a3e77a60fa..1ae1288174 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs @@ -23,6 +23,7 @@ namespace VirtualClient.Actions using Newtonsoft.Json.Linq; using NUnit.Framework; using VirtualClient.Common; + using VirtualClient.Common.ProcessAffinity; [TestFixture] [Category("Unit")] @@ -702,6 +703,55 @@ public async Task SpecCpu2017ExecutorSelectsSymmetricNumaAffinity(int nodeCount, Assert.AreEqual(expectedCoreSpec, ((IDictionary)selection.Properties["metadata_scenario"])["NumaProcessorAffinity"]); } + [TestCase(64, "0-31,64-95")] + [TestCase(40, "0-31,64-67,80-83")] + [TestCase(4, "0,1,16,17")] + public async Task SpecCpu2017ExecutorSelectsSymmetricNumaAffinityOnBifurcatedNodeCpuRanges(int copyCount, string expectedCoreSpec) + { + this.SetupLinux(Architecture.Arm64); + this.SetupInstalledAffinityRun(string.Empty); + this.mockFixture.Parameters[nameof(SpecCpuExecutor.EnableNumaProcessorAffinitySymmetric)] = true; + this.mockFixture.Parameters[nameof(SpecCpuExecutor.CopyCount)] = copyCount; + + // Each NUMA node owns two non-contiguous CPU ranges (e.g. node0 = 0-15 and 64-79). + IEnumerable node0 = Enumerable.Range(0, 16).Concat(Enumerable.Range(64, 16)); + IEnumerable node1 = Enumerable.Range(16, 16).Concat(Enumerable.Range(80, 16)); + string topology = "available: 2 nodes (0-1)\n" + + $"node 0 cpus: {string.Join(" ", node0)}\nnode 0 size: 16000 MB\nnode 0 free: 12000 MB\n" + + $"node 1 cpus: {string.Join(" ", node1)}\nnode 1 size: 16000 MB\nnode 1 free: 12000 MB"; + + string pinnedConfig = null; + this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((path, content, token) => pinnedConfig = content) + .Returns(Task.CompletedTask); + + List commands = new List(); + this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => + { + commands.Add($"{exe} {arguments}"); + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + StandardOutput = new ConcurrentBuffer(new StringBuilder(exe == "numactl" && arguments == "--hardware" ? topology : string.Empty)), + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + }; + + using (TestSpecCpu2017Executor executor = new TestSpecCpu2017Executor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) + { + await executor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + } + + string expectedCpus = string.Join(",", ProcessAffinityConfiguration.ParseCoreList(expectedCoreSpec).OrderBy(cpu => cpu)); + StringAssert.Contains($"bind = {expectedCpus}", pinnedConfig); + Assert.IsTrue(commands.Any(command => command == $"numactl --localalloc -C {expectedCoreSpec} true")); + EventContext selection = (EventContext)this.mockFixture.Logger.Single(entry => entry.Item2.Name.EndsWith(".SymmetricAffinitySelected", StringComparison.Ordinal)).Item3; + Assert.AreEqual(expectedCpus, selection.Properties["cpuIds"]); + Assert.AreEqual(expectedCoreSpec, ((IDictionary)selection.Properties["metadata_scenario"])["NumaProcessorAffinity"]); + } + [Test] public void SpecCpu2017ExecutorRejectsManualAndSymmetricAffinityTogether() { From 3dddadee778f172dc1776884189cfd9914ac7711 Mon Sep 17 00:00:00 2001 From: Deepanshu Vaid Date: Thu, 12 Nov 2026 17:45:08 +0530 Subject: [PATCH 4/6] Add GCC 14+ workaround for SPEC CPU2017 legacy C compile errors GCC 14 promotes legacy C diagnostics such as -Wimplicit-int (527.cam4_r mpi.c) to errors. Define GCCge14 when gcc >= 14 and apply -fpermissive via EXTRA_COPTIMIZE suite-wide in the Linux 2017 configs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPEC/SpecCpu2017ExecutorTests.cs | 39 +++++++++++++++++++ .../SPEC/mockspeccpu.cfg | 11 ++++++ .../SPECcpu/SpecCpu2017Executor.cs | 12 ++++++ .../SPECcpu/vc-linux-arm64-2017.cfg | 11 ++++++ .../SPECcpu/vc-linux-arm64-jemalloc-2017.cfg | 11 ++++++ .../SPECcpu/vc-linux-x64-2017.cfg | 11 ++++++ .../SPECcpu/vc-linux-x64-jemalloc-2017.cfg | 11 ++++++ 7 files changed, 106 insertions(+) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs index 1ae1288174..d7522a5a51 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs @@ -540,7 +540,10 @@ public async Task SpecCpu2017ExecutorAppliesGcc15WorkaroundWhenGccVersionIs15OrG Assert.IsNotNull(writtenConfigText); Assert.IsTrue(writtenConfigText.Contains("%define GCCge15"), "Config should contain '%define GCCge15' when GCC version is 15 or greater."); Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should also contain '%define GCCge10' when GCC version is 15 or greater."); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge14"), "Config should also contain '%define GCCge14' when GCC version is 15 or greater."); + Assert.IsTrue(writtenConfigText.Contains("EXTRA_COPTIMIZE = -fpermissive"), "Config should downgrade GCC 14+ legacy C errors."); Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced."); Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); Assert.IsTrue(writtenConfigText.Contains("-ftree-parallelize-loops=8"), "Config should use the configured thread count."); Assert.IsFalse(writtenConfigText.Contains("$Threads$"), "Placeholder '$Threads$' should be replaced."); @@ -587,10 +590,46 @@ public async Task SpecCpu2017ExecutorDoesNotApplyGcc15WorkaroundWhenGccVersionIs Assert.IsNotNull(writtenConfigText); Assert.IsFalse(writtenConfigText.Contains("%define GCCge15"), "Config should NOT contain '%define GCCge15' when GCC version is less than 15."); Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should contain '%define GCCge10' when GCC version is 10."); + Assert.IsFalse(writtenConfigText.Contains("%define GCCge14"), "Config should NOT contain '%define GCCge14' when GCC version is less than 14."); Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); + Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced."); Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); } + [Test] + public async Task SpecCpu2017ExecutorAppliesGcc14WorkaroundWhenGccVersionIs14OnLinux() + { + this.SetupLinux(); + + string writtenConfigText = null; + this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((path, content, token) => writtenConfigText = content) + .Returns(Task.CompletedTask); + + this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => + { + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, + StandardOutput = new ConcurrentBuffer(new StringBuilder(exe == "sudo" && arguments == "gcc -dumpversion" ? "14" : string.Empty)), + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + }; + + using (TestSpecCpu2017Executor specCpuExecutor = new TestSpecCpu2017Executor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) + { + await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + } + + Assert.IsNotNull(writtenConfigText); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge10")); + Assert.IsTrue(writtenConfigText.Contains("%define GCCge14")); + Assert.IsFalse(writtenConfigText.Contains("%define GCCge15")); + Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$")); + } + [TestCase("intrate", "0-3", "$SPECCOPYNUM", null)] [TestCase("intrate", "0,1,48,49", "$BIND", "bind = 0,1,48,49")] [TestCase("intrate", "2,4,8,10", "$BIND", "bind = 2,4,8,10")] diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg index a94546ae3a..8eea0b316a 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -293,6 +294,16 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M +#-------- GCC 14+ C workarounds ------------------------------------------- +# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in +# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back +# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS +# above are not overridden, and the flag applies suite-wide to base and peak. +%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) +default: + EXTRA_COPTIMIZE = -fpermissive +%endif + #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs index 7582616917..45c8471e29 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs @@ -83,6 +83,11 @@ protected override async Task CustomizeConfigurationAsync(string templat Convert.ToInt32(compilerVersion) >= 10 ? SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent : string.Empty, StringComparison.OrdinalIgnoreCase); + templateText = templateText.Replace( + SpecCpu2017ConfigPlaceholder.Gcc14Workaround, + Convert.ToInt32(compilerVersion) >= 14 ? SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent : string.Empty, + StringComparison.OrdinalIgnoreCase); + templateText = templateText.Replace( SpecCpu2017ConfigPlaceholder.Gcc15Workaround, Convert.ToInt32(compilerVersion) >= 15 ? SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent : string.Empty, @@ -95,6 +100,11 @@ protected override async Task CustomizeConfigurationAsync(string templat SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent, StringComparison.OrdinalIgnoreCase); + templateText = templateText.Replace( + SpecCpu2017ConfigPlaceholder.Gcc14Workaround, + SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent, + StringComparison.OrdinalIgnoreCase); + templateText = templateText.Replace( SpecCpu2017ConfigPlaceholder.Gcc15Workaround, SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent, @@ -108,6 +118,8 @@ private static class SpecCpu2017ConfigPlaceholder { public const string Gcc10Workaround = "$Gcc10Workaround$"; public const string Gcc10WorkaroundContent = "%define GCCge10"; + public const string Gcc14Workaround = "$Gcc14Workaround$"; + public const string Gcc14WorkaroundContent = "%define GCCge14"; public const string Gcc15Workaround = "$Gcc15Workaround$"; public const string Gcc15WorkaroundContent = "%define GCCge15"; } diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg index ee005f77b1..9fed05aa81 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg @@ -164,6 +164,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -308,6 +309,16 @@ default: # data model applies to all benchmarks preENV_OMP_STACKSIZE = 120M %endif +#-------- GCC 14+ C workarounds ------------------------------------------- +# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in +# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back +# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS +# above are not overridden, and the flag applies suite-wide to base and peak. +%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) +default: + EXTRA_COPTIMIZE = -fpermissive +%endif + #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg index e4fadac2dc..b0f400d868 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg @@ -164,6 +164,7 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later +%define GCCge14 # EDIT: remove the '#' from column 1 if using GCC 14 or later %define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime @@ -312,6 +313,16 @@ default: # data model applies to all benchmarks preENV_OMP_STACKSIZE = 120M %endif +#-------- GCC 14+ C workarounds ------------------------------------------- +# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in +# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back +# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS +# above are not overridden, and the flag applies suite-wide to base and peak. +%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) +default: + EXTRA_COPTIMIZE = -fpermissive +%endif + #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg index 73e1608624..aefec402b6 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later +$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -291,6 +292,16 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M +#-------- GCC 14+ C workarounds ------------------------------------------- +# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in +# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back +# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS +# above are not overridden, and the flag applies suite-wide to base and peak. +%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) +default: + EXTRA_COPTIMIZE = -fpermissive +%endif + #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg index 6d54238ce3..5bded540e1 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg @@ -158,6 +158,7 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later +%define GCCge14 # EDIT: remove the '#' from column 1 if using GCC 14 or later %define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime @@ -295,6 +296,16 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M +#-------- GCC 14+ C workarounds ------------------------------------------- +# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in +# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back +# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS +# above are not overridden, and the flag applies suite-wide to base and peak. +%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) +default: + EXTRA_COPTIMIZE = -fpermissive +%endif + #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove From 98352a51ebd810dacf7ed20bb5e7c7c19467a0b5 Mon Sep 17 00:00:00 2001 From: Deepanshu Vaid Date: Thu, 19 Nov 2026 15:02:50 +0530 Subject: [PATCH 5/6] Revert "Add GCC 14+ workaround for SPEC CPU2017 legacy C compile errors" This reverts commit c4c26c933aaf78052a8c059442605054d8964800. --- .../SPEC/SpecCpu2017ExecutorTests.cs | 39 ------------------- .../SPEC/mockspeccpu.cfg | 11 ------ .../SPECcpu/SpecCpu2017Executor.cs | 12 ------ .../SPECcpu/vc-linux-arm64-2017.cfg | 11 ------ .../SPECcpu/vc-linux-arm64-jemalloc-2017.cfg | 11 ------ .../SPECcpu/vc-linux-x64-2017.cfg | 11 ------ .../SPECcpu/vc-linux-x64-jemalloc-2017.cfg | 11 ------ 7 files changed, 106 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs index d7522a5a51..1ae1288174 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs @@ -540,10 +540,7 @@ public async Task SpecCpu2017ExecutorAppliesGcc15WorkaroundWhenGccVersionIs15OrG Assert.IsNotNull(writtenConfigText); Assert.IsTrue(writtenConfigText.Contains("%define GCCge15"), "Config should contain '%define GCCge15' when GCC version is 15 or greater."); Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should also contain '%define GCCge10' when GCC version is 15 or greater."); - Assert.IsTrue(writtenConfigText.Contains("%define GCCge14"), "Config should also contain '%define GCCge14' when GCC version is 15 or greater."); - Assert.IsTrue(writtenConfigText.Contains("EXTRA_COPTIMIZE = -fpermissive"), "Config should downgrade GCC 14+ legacy C errors."); Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); - Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced."); Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); Assert.IsTrue(writtenConfigText.Contains("-ftree-parallelize-loops=8"), "Config should use the configured thread count."); Assert.IsFalse(writtenConfigText.Contains("$Threads$"), "Placeholder '$Threads$' should be replaced."); @@ -590,46 +587,10 @@ public async Task SpecCpu2017ExecutorDoesNotApplyGcc15WorkaroundWhenGccVersionIs Assert.IsNotNull(writtenConfigText); Assert.IsFalse(writtenConfigText.Contains("%define GCCge15"), "Config should NOT contain '%define GCCge15' when GCC version is less than 15."); Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should contain '%define GCCge10' when GCC version is 10."); - Assert.IsFalse(writtenConfigText.Contains("%define GCCge14"), "Config should NOT contain '%define GCCge14' when GCC version is less than 14."); Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced."); - Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced."); Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced."); } - [Test] - public async Task SpecCpu2017ExecutorAppliesGcc14WorkaroundWhenGccVersionIs14OnLinux() - { - this.SetupLinux(); - - string writtenConfigText = null; - this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback((path, content, token) => writtenConfigText = content) - .Returns(Task.CompletedTask); - - this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => - { - return new InMemoryProcess - { - StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments }, - StandardOutput = new ConcurrentBuffer(new StringBuilder(exe == "sudo" && arguments == "gcc -dumpversion" ? "14" : string.Empty)), - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true - }; - }; - - using (TestSpecCpu2017Executor specCpuExecutor = new TestSpecCpu2017Executor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) - { - await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); - } - - Assert.IsNotNull(writtenConfigText); - Assert.IsTrue(writtenConfigText.Contains("%define GCCge10")); - Assert.IsTrue(writtenConfigText.Contains("%define GCCge14")); - Assert.IsFalse(writtenConfigText.Contains("%define GCCge15")); - Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$")); - } - [TestCase("intrate", "0-3", "$SPECCOPYNUM", null)] [TestCase("intrate", "0,1,48,49", "$BIND", "bind = 0,1,48,49")] [TestCase("intrate", "2,4,8,10", "$BIND", "bind = 2,4,8,10")] diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg index 8eea0b316a..a94546ae3a 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/mockspeccpu.cfg @@ -158,7 +158,6 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later -$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -294,16 +293,6 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M -#-------- GCC 14+ C workarounds ------------------------------------------- -# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in -# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back -# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS -# above are not overridden, and the flag applies suite-wide to base and peak. -%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) -default: - EXTRA_COPTIMIZE = -fpermissive -%endif - #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs index 45c8471e29..7582616917 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpu2017Executor.cs @@ -83,11 +83,6 @@ protected override async Task CustomizeConfigurationAsync(string templat Convert.ToInt32(compilerVersion) >= 10 ? SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent : string.Empty, StringComparison.OrdinalIgnoreCase); - templateText = templateText.Replace( - SpecCpu2017ConfigPlaceholder.Gcc14Workaround, - Convert.ToInt32(compilerVersion) >= 14 ? SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent : string.Empty, - StringComparison.OrdinalIgnoreCase); - templateText = templateText.Replace( SpecCpu2017ConfigPlaceholder.Gcc15Workaround, Convert.ToInt32(compilerVersion) >= 15 ? SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent : string.Empty, @@ -100,11 +95,6 @@ protected override async Task CustomizeConfigurationAsync(string templat SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent, StringComparison.OrdinalIgnoreCase); - templateText = templateText.Replace( - SpecCpu2017ConfigPlaceholder.Gcc14Workaround, - SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent, - StringComparison.OrdinalIgnoreCase); - templateText = templateText.Replace( SpecCpu2017ConfigPlaceholder.Gcc15Workaround, SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent, @@ -118,8 +108,6 @@ private static class SpecCpu2017ConfigPlaceholder { public const string Gcc10Workaround = "$Gcc10Workaround$"; public const string Gcc10WorkaroundContent = "%define GCCge10"; - public const string Gcc14Workaround = "$Gcc14Workaround$"; - public const string Gcc14WorkaroundContent = "%define GCCge14"; public const string Gcc15Workaround = "$Gcc15Workaround$"; public const string Gcc15WorkaroundContent = "%define GCCge15"; } diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg index 9fed05aa81..ee005f77b1 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-2017.cfg @@ -164,7 +164,6 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later -$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -309,16 +308,6 @@ default: # data model applies to all benchmarks preENV_OMP_STACKSIZE = 120M %endif -#-------- GCC 14+ C workarounds ------------------------------------------- -# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in -# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back -# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS -# above are not overridden, and the flag applies suite-wide to base and peak. -%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) -default: - EXTRA_COPTIMIZE = -fpermissive -%endif - #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg index b0f400d868..e4fadac2dc 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-arm64-jemalloc-2017.cfg @@ -164,7 +164,6 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later -%define GCCge14 # EDIT: remove the '#' from column 1 if using GCC 14 or later %define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime @@ -313,16 +312,6 @@ default: # data model applies to all benchmarks preENV_OMP_STACKSIZE = 120M %endif -#-------- GCC 14+ C workarounds ------------------------------------------- -# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in -# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back -# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS -# above are not overridden, and the flag applies suite-wide to base and peak. -%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) -default: - EXTRA_COPTIMIZE = -fpermissive -%endif - #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg index aefec402b6..73e1608624 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-2017.cfg @@ -158,7 +158,6 @@ default: # line to avoid compile errors for several FP benchmarks # $Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later -$Gcc14Workaround$ # workaround for GCC v14 (and presumably later) $Gcc15Workaround$ # workaround for GCC v15 (and presumably later) # EDIT if needed: the preENV line adds library directories to the runtime @@ -292,16 +291,6 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M -#-------- GCC 14+ C workarounds ------------------------------------------- -# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in -# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back -# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS -# above are not overridden, and the flag applies suite-wide to base and peak. -%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) -default: - EXTRA_COPTIMIZE = -fpermissive -%endif - #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg index 5bded540e1..6d54238ce3 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/vc-linux-x64-jemalloc-2017.cfg @@ -158,7 +158,6 @@ default: # line to avoid compile errors for several FP benchmarks # %define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later -%define GCCge14 # EDIT: remove the '#' from column 1 if using GCC 14 or later %define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later # EDIT if needed: the preENV line adds library directories to the runtime @@ -296,16 +295,6 @@ fpspeed: # preENV_OMP_STACKSIZE = 128M -#-------- GCC 14+ C workarounds ------------------------------------------- -# GCC 14 promotes several legacy C diagnostics (e.g. -Wimplicit-int in -# 527.cam4_r mpi.c) from warnings to errors. -fpermissive downgrades them back -# to warnings. EXTRA_COPTIMIZE is used so the benchmark-specific EXTRA_CFLAGS -# above are not overridden, and the flag applies suite-wide to base and peak. -%ifdef %{GCCge14} # workaround for GCC v14 (and presumably later) -default: - EXTRA_COPTIMIZE = -fpermissive -%endif - #-------- Base Tuning Flags ---------------------------------------------- # EDIT if needed -- If you run into errors, you may need to adjust the # optimization - for example you may need to remove From 021592693d8d5e8f8425c03b0e934bc98f889b77 Mon Sep 17 00:00:00 2001 From: Deepanshu Vaid Date: Thu, 19 Nov 2026 15:25:22 +0530 Subject: [PATCH 6/6] Add 41-copy case to SPECcpu bifurcated NUMA symmetric affinity test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPEC/SpecCpu2017ExecutorTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs index 1ae1288174..4834c7d679 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpu2017ExecutorTests.cs @@ -705,6 +705,7 @@ public async Task SpecCpu2017ExecutorSelectsSymmetricNumaAffinity(int nodeCount, [TestCase(64, "0-31,64-95")] [TestCase(40, "0-31,64-67,80-83")] + [TestCase(41, "0-31,64-68,80-83")] [TestCase(4, "0,1,16,17")] public async Task SpecCpu2017ExecutorSelectsSymmetricNumaAffinityOnBifurcatedNodeCpuRanges(int copyCount, string expectedCoreSpec) {