[Bugfix:Autograding] Fix negative number tolerance#12569
Conversation
|
@williamjallen @JManion32 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12569 +/- ##
=========================================
Coverage 21.64% 21.64%
Complexity 9654 9654
=========================================
Files 268 268
Lines 36244 36244
Branches 487 487
=========================================
Hits 7845 7845
Misses 27916 27916
Partials 483 483
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Hi @Akarshkushwaha {
"assignment_message": "Calculate average and standard deviation given a list of number by filtering only positive numbers. Result expected with a precision of three decimal places.",
"required_capabilities": "python",
"autograding_method": "docker",
"container_options": {
"container_image": "submitty/python:latest"
},
"testcases": [
{
"title" : "Allow Minor Numeric Noise (+/-0.05 Tolerance)",
"command" : [ "python3 *.py" ],
"points" : 10,
"validation": [
{
"description": "diff w/ tolerance=0.05",
"method": "diff",
"tolerance": 0.05,
"actual_file": "STDOUT.txt",
"expected_file": "test_output.txt",
"deduction": 1,
"failure_message":"These files have numeric errors > 0.05 or whitespace or text differences."
}
]
}
]
}I rebuilt the autograder using |
|
Hi @Eli-J-Schwartz Thankyou for testing this out locally. Your config.json is perfectly correct! I believe the issue is simply with the way the C++ autograder builds local executables. When you ran However, because Submitty's autograder relies on static linking, existing gradeables do not automatically inherit these changes. Their How to test the fix:
Clicking "Build Gradeable" forces Submitty to re-run CMake specifically for that assignment, linking the newly patched Once I clicked "Build Gradeable" on my end using a config identical to yours, I submitted Let me know if rebuilding the gradeable from the UI works for you |
Eli-J-Schwartz
left a comment
There was a problem hiding this comment.
Hi @Akarshkushwaha,
Thank you for the help on testing your changes. The tolerance check now works as intended for me; see the screenshots below for examples.
The code also looks good; the changes are all clearly documented and seem to be free of bugs.
However, I noticed that the PR is failing a couple of tests. The CI / Cypress (Gradable) test is a known test failure on the main branch, and not a problem with your code. The CI / Integration test seems to be an issue with your modified testing code. It looks like your added test isn't integrated properly with the testing framework, causing an error. Additionally, it's possible that your changes have modified the output of earlier tests. Once the tests are fixed, I think this PR is good to merge.
…nup integration tests
8573553 to
b8787ef
Compare
…atting & scope cleanup)
Eli-J-Schwartz
left a comment
There was a problem hiding this comment.
I'm glad to see that the tests are passing, and the new test you added seems like it's properly integrated with the rest of the tests as well. I think you might have accidentally removed the fewer spaces test; if you add it back I will approve this PR.
Eli-J-Schwartz
left a comment
There was a problem hiding this comment.
All my previous requests were implemented as necessary. Everything else looks good.
* main: (50 commits) [Bugfix:Developer] Fix Broken CI (#12851) [Bugfix:System] Restore TCLAPP (#12850) [Bugfix:Submission] Fix non-VCS repo error (#12608) [Feature:Submission] Jupyter warnings outside notebook (#12523) [Bugfix:InstructorUI] Removed feature flag for Bulk Late Days (#12826) [Bugfix:Forum] Fix stats header rendering (#12698) [Bugfix:Autograding] Fix negative number tolerance (#12569) [Bugfix:HelpQueue] Always use Abbreviated Names in OH (#12820) [Bugfix:Autograding] Fix regrade team detection (#12737) [Dependency] Bump Lichen from v23.09.00 to v26.04.01 (#12823) [Dependency] Bump RainbowGrades from v25.10.00 to v26.04.01 (#12824) [Feature:Developer] Remove misc Java utils and TCLAPP (#12819) [Bugfix:TAGrading] Fix 2-panel open-document select (#12577) [Dependency] Bump AnalysisToolsTS from v23.10.00 to v26.04.00 (#12822) [Bugfix:Developer] Fix bump_repo permissions (#12821) [Bugfix:InstructorUI] Change Colors to match in Docker UI table (#12739) [Bugfix:Forum] Reduce Page Caching (#12339) [Bugfix:System] File lost when running install clean fix (#12158) [Bugfix:Submission] No File Rubric submit all user groups (#12812) [Dependency] Bump twig/markdown-extra from 3.23.0 to 3.24.0 in /site (#12721) ...


Why is this Change Important & Necessary?
Fixes #10702
Tolerance grading does not work correctly with negative numbers. When the expected output is a negative value like
-5.5with a tolerance, the isolateAlphanumAndNumberPunctuation function in grading/clean.cpp strips the leading minus sign, turning-5.5into5.5. This causes a student submitting5.5to incorrectly receive full credit when-5.5is expected, because both values are compared as the same positive number.What is the New Behavior?
The autograder now correctly preserves the leading minus sign on negative numbers during tolerance comparison. A student submitting
5.5when-5.5is expected will now correctly receive 0 points, as abs(-5.5 - 5.5) = 11.0 exceeds the tolerance.What steps should a reviewer take to reproduce or test the bug or new feature?
-5.5with tolerance0.5)5.5)Automated Testing & Documentation
tolerance_checkintegration test suite--5,1-2,-, empty string) — all passedOther information