Use stable hashed row keys for msbench eval sync#2747
Open
fallintoplace wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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)usingsha256(...).digest("base64url")for stable, safe row keys. - Adds
toSafeString()normalization and persistsinstance_id,benchmark, andmodelas 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rowKey = benchmark_modelconstruction with a deterministic key:base64url(sha256(instance_id|benchmark|model)).instance_id,benchmark, andmodelas table properties for queryability and traceability.Notes
/,\\,#,?) and collision risks from concatenated keys.