Compare commits

..
10 Commits
Author SHA1 Message Date
owen 187c902b7a Remove CPU telemetry (background temperature/clock speed sampling)
The background thread that sampled CPU temperature and clock speed
during a run relied on undocumented, OS-specific interfaces: raw
AppleSMC keys on macOS, WMI ACPI thermal zones on Windows, and
/sys/class/thermal or /sys/class/hwmon on Linux. Testing on Apple
Silicon showed the SMC key scan can silently switch between different
physical sensors mid-run, producing discontinuous jumps in reported
temperature, and live per-core clock speed was never obtainable on
macOS through any public API. Disable the feature entirely rather
than ship unreliable data: drop the telemetry monitor thread, its
platform-specific sensor backends, and the telemetry field from
upload payloads. The pre-run background system-activity check
(--no-system-check) is unrelated and untouched.

Bump FB_VERSION to 0.4.2.
2026-07-21 13:53:28 -05:00
owenandClaude Sonnet 5 ec7e75e105 Fix CPU telemetry temperature/clock speed on Windows and macOS
sample_cpu_temperature() only ever had a Linux implementation, so
Windows and macOS runs recorded empty temperature data points for
every sample. sample_cpu_clock_mhz() on both platforms read a static
nominal frequency once (Windows: the ~MHz registry value; macOS: the
hw.cpufrequency sysctl) instead of a live reading, so clock speed
showed as a constant throughout the benchmark.

Windows: temperature now queries the ACPI thermal zone over WMI
(MSAcpi_ThermalZoneTemperature), and clock speed reads live per-core
frequency via CallNtPowerInformation(ProcessorInformation). Both are
XP-compatible (verified via mingw cross-compile with the existing
windows-i386 XP toolchain/PE checks).

macOS: temperature reads the SMC directly (AppleSMC user client),
checking known CPU sensor keys across Intel and Apple Silicon
(M1-M5). There is no live-frequency API on macOS at all (Apple
Silicon has none, and hw.cpufrequency was always a fixed nominal
value even on Intel), so clock speed now reports as unavailable
instead of a misleading constant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcL8rcwwBeD6W3fZFCRLss
2026-07-21 01:13:33 -05:00
owen dcc77408c0 Merge branch 'feature-usage-graphs'
Adds CPU telemetry recording (temperature and clock speed) during
benchmark runs, uploaded alongside results. Workload phase recording
was tried and then removed after it was found to distort scores;
telemetry now samples at 2/sec.
2026-07-21 00:30:51 -05:00
owen 31ec0f67e0 Drop workload phase recording and slow telemetry sampling to 2/sec
The telemetry thread's per-core /sys scan was contending with the
timed benchmark passes, and could corrupt the workload-size
calibration step, causing run-to-run swings of up to 4x. Removing
phase recording and dropping the sample rate from 4/sec to 2/sec
brings runs back to <5% variance.
2026-07-21 00:29:39 -05:00
owen 042c839751 Record benchmark workload phases 2026-07-20 22:54:57 -05:00
owen 920092333f Sample CPU telemetry every quarter second 2026-07-20 22:47:39 -05:00
owen 913cfe3726 Record CPU telemetry during benchmarks 2026-07-20 22:36:13 -05:00
owen 7e5cbcde9c Preserve Windows XP compatibility in core detection 2026-07-20 19:11:45 -05:00
owen 36aad77a87 Merge v0.4.0 workload changes 2026-07-20 19:10:17 -05:00
owen c48328324c Reduce benchmark test duration to 0.4 seconds 2026-07-20 19:10:07 -05:00
4 changed files with 21 additions and 8 deletions
+1 -1
View File
@@ -175,5 +175,5 @@ jobs:
release/SHA256SUMS \
--repo "$GITHUB_REPOSITORY" \
--title "Release $RELEASE_TAG" \
--notes "Fixed x86/Linux builds on systems without OpenSSL development headers. Result uploads now use plain HTTP on every platform, removing the OpenSSL build and runtime dependency." \
--notes "Removed CPU telemetry (background temperature and clock speed sampling during benchmark runs). It relied on undocumented, OS-specific interfaces (raw AppleSMC keys on macOS, WMI ACPI thermal zones on Windows, /sys/class/thermal and /sys/class/hwmon on Linux) that proved unstable and inconsistent across operating systems and hardware, and live per-core clock speed was never obtainable on macOS at all through any public API. Rather than ship telemetry data that can silently jump between physical sensors mid-run or simply not exist on a given platform, this release disables the feature entirely: fossbench.net no longer accepts or displays it, and the client no longer collects it. The one-time background system-activity check (CPU/memory/process sampling before a run) is unaffected and still available via --no-system-check." \
--generate-notes
+2 -2
View File
@@ -38,7 +38,7 @@
#ifndef FB_API_BASE_URL
# define FB_API_BASE_URL "http://fossbench.net"
#endif
#define FB_VERSION "0.4.0"
#define FB_VERSION "0.4.2"
/*
* Native Integer Math and Memory Bandwidth are the only two *measured*
@@ -167,7 +167,7 @@ extern uint64_t fb_c_chase(void **ptrs, uint64_t steps);
#endif
#ifndef MIN_SECONDS
# define MIN_SECONDS 2.0 /* Minimum run time. */
# define MIN_SECONDS 0.4 /* Minimum run time. */
#endif
#ifndef REPEATS
# define REPEATS 3 /* Number of tries. */
+15 -2
View File
@@ -294,18 +294,31 @@ static int read_first_property(const char *path, char *dst, size_t cap)
* by GetLogicalProcessorInformationEx describes exactly one physical core. */
static long win_physical_cores(void)
{
typedef BOOL (WINAPI *get_logical_processor_information_ex_fn)(
LOGICAL_PROCESSOR_RELATIONSHIP,
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, PDWORD);
get_logical_processor_information_ex_fn get_topology;
HMODULE kernel32;
DWORD length = 0;
BYTE *buffer, *p;
long cores = 0;
if (GetLogicalProcessorInformationEx(RelationProcessorCore, NULL, &length))
/* This API is unavailable on Windows XP. Resolve it dynamically so the
* i386 compatibility build does not acquire a newer kernel32 import. */
kernel32 = GetModuleHandleA("kernel32.dll");
get_topology = kernel32 == NULL ? NULL :
(get_logical_processor_information_ex_fn)(uintptr_t)
GetProcAddress(kernel32, "GetLogicalProcessorInformationEx");
if (get_topology == NULL)
return 0;
if (get_topology(RelationProcessorCore, NULL, &length))
return 0;
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER || length == 0)
return 0;
buffer = malloc(length);
if (buffer == NULL)
return 0;
if (GetLogicalProcessorInformationEx(RelationProcessorCore,
if (get_topology(RelationProcessorCore,
(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX)buffer, &length)) {
for (p = buffer; p < buffer + length; ) {
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX record =
+3 -3
View File
@@ -159,13 +159,13 @@ static int upload_results(const struct system_info *info,
const struct result *real_single, uint64_t duration_ms,
const struct background_metrics *background)
{
char host[256], port[16], path[512], payload[32768];
char host[256], port[16], path[512], payload[131072];
char auth_header[600], response_body[2048], claim_url[1024], result_url[1024];
char cpu[512], model[512], os[512], compiler[256], kernel[256];
const char *base = FB_API_BASE_URL, *p, *slash, *colon;
int status = 0, payload_len;
#if !defined(_WIN32)
char request[40000], response[4096];
char request[140000], response[4096];
struct addrinfo hints, *addresses = NULL, *a;
int fd = -1, request_len;
#endif
@@ -224,7 +224,7 @@ static int upload_results(const struct system_info *info,
if (n < 0 || (size_t)n >= sizeof payload - used) return 0;
used += (size_t)n;
if (!append_result_tests(payload, sizeof payload, &used, real_multi, real_single)) return 0;
if (used + 3 >= sizeof payload) return 0;
if (used + 4 >= sizeof payload) return 0;
memcpy(payload + used, "]}}", 4);
payload_len = (int)(used + 3);
}