-
Notifications
You must be signed in to change notification settings - Fork 1
feat(wasm-runtime): complete host function infrastructure for WASM challenges #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5ebb99e
337d8bb
c341103
f0e41dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ pub fn output_to_response( | |
| execution_time_ms: i64, | ||
| ) -> EvalResponse { | ||
| if output.valid { | ||
| let score = output.score as f64 / 100.0; | ||
| let score = output.score as f64 / 10_000.0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Score normalization now correctly matches The divisor However, note that let normalized = (output.score as f64) / i64::MAX as f64;A challenge using Proposed fix in bins/validator-node/src/main.rs- let normalized = (output.score as f64) / i64::MAX as f64;
+ let normalized = (output.score as f64) / 10_000.0;🤖 Prompt for AI Agents |
||
| let results = serde_json::json!({ "message": output.message }); | ||
| EvalResponse::success(request_id, score, results).with_time(execution_time_ms) | ||
| } else { | ||
|
|
@@ -185,7 +185,7 @@ mod tests { | |
|
|
||
| #[test] | ||
| fn test_output_to_response_success() { | ||
| let output = EvaluationOutput::success(100, "perfect"); | ||
| let output = EvaluationOutput::success(10000, "perfect"); | ||
| let resp = output_to_response(&output, "req-1", 42); | ||
| assert!(resp.success); | ||
| assert_eq!(resp.request_id, "req-1"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 111
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 1332
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 1970
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 2602
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 4547
🏁 Script executed:
Repository: PlatformNetwork/platform-v2
Length of output: 429
call_return_i64method confirmed to exist — the ABI fix is correctly implemented. The bit-unpacking logic(len << 32) | ptris properly inverted via(result >> 32)and(result & 0xFFFF_FFFF).On line 442,
.unwrap_or_default()silently discards read_memory errors, which diverges from the error-handling pattern used elsewhere in this file (e.g.,map_errwith explicit error messages). Sinceread_memorycan fail for out-of-bounds access or invalid addresses, consider replacing.unwrap_or_default()with proper error handling or at least logging to preserve debuggability.🤖 Prompt for AI Agents