Skip to content

Use stable hashed row keys for msbench eval sync#2747

Open
fallintoplace wants to merge 3 commits into
microsoft:mainfrom
fallintoplace:fix/msbench-row-key-hash
Open

Use stable hashed row keys for msbench eval sync#2747
fallintoplace wants to merge 3 commits into
microsoft:mainfrom
fallintoplace:fix/msbench-row-key-hash

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • Replace unstable rowKey = benchmark_model construction with a deterministic key: base64url(sha256(instance_id|benchmark|model)).
  • Persist instance_id, benchmark, and model as table properties for queryability and traceability.

Notes

  • This addresses invalid Azure Table row key characters (e.g. /, \\, #, ?) and collision risks from concatenated keys.
  • No query/filter behavior changes are included in this change.

Copilot AI review requested due to automatic review settings July 5, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the msbench eval-metrics sync function to use deterministic, Azure-Table-safe row keys (SHA-256 base64url) instead of a concatenated string key, and to persist identifying fields as separate table properties for traceability/querying.

Changes:

  • Introduces buildMsbenchRowKey(instanceId, benchmark, model) using sha256(...).digest("base64url") for stable, safe row keys.
  • Adds toSafeString() normalization and persists instance_id, benchmark, and model as entity properties during upsert.
  • Updates the upsert logic to use the new hashed rowKey (instead of ${benchmark}_${model}).

Comment on lines +22 to +24
function toSafeString(value: string | undefined): string {
return value?.trim() ? value : "unknown";
}
Comment on lines +26 to +29
function buildMsbenchRowKey(instanceId: string, benchmark: string, model: string): string {
const payload = `${instanceId}|${benchmark}|${model}`;
return createHash("sha256").update(payload).digest("base64url");
}
Comment on lines +120 to +122
const instanceId = toSafeString(report.instance_id);
const benchmark = toSafeString(report.benchmark ?? instanceId);
const model = toSafeString(report.model);
Comment on lines 124 to +127
await tableClient.upsertEntity({
partitionKey: date,
rowKey: `${benchmark}_${model}`,
rowKey: buildMsbenchRowKey(instanceId, benchmark, model),
instance_id: instanceId,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants