Update original media workflow tasks
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- MANIFEST.json +416 -136
- README.md +5 -5
- SHA256SUMS +118 -48
- SOURCE_LOCK.json +5 -5
- components/{skillsdesk → qemedia}/.dockerignore +0 -0
- components/qemedia/ADAPTER_NOTICE +3 -0
- components/qemedia/Dockerfile +16 -0
- components/qemedia/LICENSE +21 -0
- components/qemedia/README.md +4 -0
- components/qemedia/SOURCE_MANIFEST.json +131 -0
- components/qemedia/THIRD_PARTY_NOTICES +63 -0
- components/qemedia/UPSTREAM_DOCKERFILE +33 -0
- components/qemedia/runtime/qemedia_compat/__init__.py +1 -0
- components/qemedia/runtime/qemedia_compat/environment.py +170 -0
- components/qemedia/runtime/qemedia_compat/server.py +16 -0
- components/qemedia/upstream/qe_arena/__init__.py +1 -0
- components/qemedia/upstream/qe_arena/app.py +21 -0
- components/qemedia/upstream/qe_arena/corpus/__init__.py +154 -0
- components/qemedia/upstream/qe_arena/corpus/aggregate_risk_factors.py +53 -0
- components/qemedia/upstream/qe_arena/corpus/alternate_chat_roles.py +53 -0
- components/qemedia/upstream/qe_arena/corpus/amortization_schedule.py +71 -0
- components/qemedia/upstream/qe_arena/corpus/api_complexity_level.py +57 -0
- components/qemedia/upstream/qe_arena/corpus/artifact_retention_keep.py +62 -0
- components/qemedia/upstream/qe_arena/corpus/backoff_schedule.py +53 -0
- components/qemedia/upstream/qe_arena/corpus/badge_dimensions.py +52 -0
- components/qemedia/upstream/qe_arena/corpus/baseline_verdict.py +60 -0
- components/qemedia/upstream/qe_arena/corpus/booking_conflicts.py +60 -0
- components/qemedia/upstream/qe_arena/corpus/boundary_violations.py +83 -0
- components/qemedia/upstream/qe_arena/corpus/brace_delta.py +59 -0
- components/qemedia/upstream/qe_arena/corpus/calibration_fit.py +52 -0
- components/qemedia/upstream/qe_arena/corpus/chat_completion_result.py +71 -0
- components/qemedia/upstream/qe_arena/corpus/claim_steal_priority.py +60 -0
- components/qemedia/upstream/qe_arena/corpus/compare_versions.py +67 -0
- components/qemedia/upstream/qe_arena/corpus/complexity_bucket.py +68 -0
- components/qemedia/upstream/qe_arena/corpus/compound_interest.py +70 -0
- components/qemedia/upstream/qe_arena/corpus/convert_timecode.py +63 -0
- components/qemedia/upstream/qe_arena/corpus/coverage_gap_severity.py +59 -0
- components/qemedia/upstream/qe_arena/corpus/crop_to_aspect.py +56 -0
- components/qemedia/upstream/qe_arena/corpus/debounce_switch.py +63 -0
- components/qemedia/upstream/qe_arena/corpus/decay_table.py +54 -0
- components/qemedia/upstream/qe_arena/corpus/efficiency_reward.py +54 -0
- components/qemedia/upstream/qe_arena/corpus/expense_violations.py +62 -0
- components/qemedia/upstream/qe_arena/corpus/find_stop.py +66 -0
- components/qemedia/upstream/qe_arena/corpus/flakiness_pattern.py +68 -0
- components/qemedia/upstream/qe_arena/corpus/flaky_hunter_reward.py +53 -0
- components/qemedia/upstream/qe_arena/corpus/flaky_run_summary.py +58 -0
- components/qemedia/upstream/qe_arena/corpus/format_duration.py +42 -0
- components/qemedia/upstream/qe_arena/corpus/gguf_loader.py +79 -0
- components/qemedia/upstream/qe_arena/corpus/gguf_special_ids.py +85 -0
- components/qemedia/upstream/qe_arena/corpus/glob_match.py +82 -0
MANIFEST.json
CHANGED
|
@@ -1,196 +1,476 @@
|
|
| 1 |
{
|
| 2 |
"files": {
|
| 3 |
"README.md": {
|
| 4 |
-
"bytes":
|
| 5 |
-
"sha256": "
|
| 6 |
},
|
| 7 |
"SOURCE_LOCK.json": {
|
| 8 |
-
"bytes":
|
| 9 |
-
"sha256": "
|
| 10 |
},
|
| 11 |
-
"components/
|
| 12 |
"bytes": 29,
|
| 13 |
"sha256": "60c9bdd905fcf45ac485c680d32e9773962cf061b6f041dcddd033911558a672"
|
| 14 |
},
|
| 15 |
-
"components/
|
| 16 |
-
"bytes":
|
| 17 |
-
"sha256": "
|
| 18 |
},
|
| 19 |
-
"components/
|
| 20 |
-
"bytes":
|
| 21 |
-
"sha256": "
|
| 22 |
},
|
| 23 |
-
"components/
|
| 24 |
-
"bytes":
|
| 25 |
-
"sha256": "
|
| 26 |
},
|
| 27 |
-
"components/
|
| 28 |
-
"bytes":
|
| 29 |
-
"sha256": "
|
| 30 |
},
|
| 31 |
-
"components/
|
| 32 |
-
"bytes":
|
| 33 |
-
"sha256": "
|
| 34 |
},
|
| 35 |
-
"components/
|
| 36 |
-
"bytes":
|
| 37 |
-
"sha256": "
|
| 38 |
},
|
| 39 |
-
"components/
|
| 40 |
-
"bytes":
|
| 41 |
-
"sha256": "
|
| 42 |
},
|
| 43 |
-
"components/
|
| 44 |
-
"bytes":
|
| 45 |
-
"sha256": "
|
| 46 |
},
|
| 47 |
-
"components/
|
| 48 |
-
"bytes":
|
| 49 |
-
"sha256": "
|
| 50 |
},
|
| 51 |
-
"components/
|
| 52 |
-
"bytes":
|
| 53 |
-
"sha256": "
|
| 54 |
},
|
| 55 |
-
"components/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
"bytes": 1941,
|
| 57 |
-
"sha256": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
},
|
| 59 |
-
"components/
|
| 60 |
-
"bytes":
|
| 61 |
-
"sha256": "
|
| 62 |
},
|
| 63 |
-
"components/
|
| 64 |
-
"bytes":
|
| 65 |
-
"sha256": "
|
| 66 |
},
|
| 67 |
-
"components/
|
| 68 |
-
"bytes":
|
| 69 |
-
"sha256": "
|
| 70 |
},
|
| 71 |
-
"components/
|
| 72 |
-
"bytes":
|
| 73 |
-
"sha256": "
|
| 74 |
},
|
| 75 |
-
"components/
|
| 76 |
-
"bytes":
|
| 77 |
-
"sha256": "
|
| 78 |
},
|
| 79 |
-
"components/
|
| 80 |
-
"bytes":
|
| 81 |
-
"sha256": "
|
| 82 |
},
|
| 83 |
-
"components/
|
| 84 |
-
"bytes":
|
| 85 |
-
"sha256": "
|
| 86 |
},
|
| 87 |
-
"components/
|
| 88 |
-
"bytes":
|
| 89 |
-
"sha256": "
|
| 90 |
},
|
| 91 |
-
"components/
|
| 92 |
-
"bytes":
|
| 93 |
-
"sha256": "
|
| 94 |
},
|
| 95 |
-
"components/
|
| 96 |
-
"bytes":
|
| 97 |
-
"sha256": "
|
| 98 |
},
|
| 99 |
-
"components/
|
| 100 |
-
"bytes":
|
| 101 |
-
"sha256": "
|
| 102 |
},
|
| 103 |
-
"components/
|
| 104 |
-
"bytes":
|
| 105 |
-
"sha256": "
|
| 106 |
},
|
| 107 |
-
"components/
|
| 108 |
-
"bytes":
|
| 109 |
-
"sha256": "
|
| 110 |
},
|
| 111 |
-
"components/
|
| 112 |
-
"bytes":
|
| 113 |
-
"sha256": "
|
| 114 |
},
|
| 115 |
-
"components/
|
| 116 |
-
"bytes":
|
| 117 |
-
"sha256": "
|
| 118 |
},
|
| 119 |
-
"components/
|
| 120 |
-
"bytes":
|
| 121 |
-
"sha256": "
|
| 122 |
},
|
| 123 |
-
"components/
|
| 124 |
-
"bytes":
|
| 125 |
-
"sha256": "
|
| 126 |
},
|
| 127 |
-
"components/
|
| 128 |
-
"bytes":
|
| 129 |
-
"sha256": "
|
| 130 |
},
|
| 131 |
-
"components/
|
| 132 |
-
"bytes":
|
| 133 |
-
"sha256": "
|
| 134 |
},
|
| 135 |
-
"components/
|
| 136 |
-
"bytes":
|
| 137 |
-
"sha256": "
|
| 138 |
},
|
| 139 |
-
"components/
|
| 140 |
-
"bytes":
|
| 141 |
-
"sha256": "
|
| 142 |
},
|
| 143 |
-
"components/
|
| 144 |
-
"bytes":
|
| 145 |
-
"sha256": "
|
| 146 |
},
|
| 147 |
-
"components/
|
| 148 |
-
"bytes":
|
| 149 |
-
"sha256": "
|
| 150 |
},
|
| 151 |
-
"components/
|
| 152 |
-
"bytes":
|
| 153 |
-
"sha256": "
|
| 154 |
},
|
| 155 |
-
"components/
|
| 156 |
-
"bytes":
|
| 157 |
-
"sha256": "
|
| 158 |
},
|
| 159 |
-
"components/
|
| 160 |
-
"bytes":
|
| 161 |
-
"sha256": "
|
| 162 |
},
|
| 163 |
-
"components/
|
| 164 |
-
"bytes":
|
| 165 |
-
"sha256": "
|
| 166 |
},
|
| 167 |
-
"components/
|
| 168 |
-
"bytes":
|
| 169 |
-
"sha256": "
|
| 170 |
},
|
| 171 |
-
"components/
|
| 172 |
-
"bytes":
|
| 173 |
-
"sha256": "
|
| 174 |
},
|
| 175 |
-
"components/
|
| 176 |
-
"bytes":
|
| 177 |
-
"sha256": "
|
| 178 |
},
|
| 179 |
-
"components/
|
| 180 |
-
"bytes":
|
| 181 |
-
"sha256": "
|
| 182 |
},
|
| 183 |
"schema.json": {
|
| 184 |
-
"bytes":
|
| 185 |
-
"sha256": "
|
| 186 |
},
|
| 187 |
"tasks.jsonl": {
|
| 188 |
-
"bytes":
|
| 189 |
-
"sha256": "
|
| 190 |
},
|
| 191 |
"validate_dataset.py": {
|
| 192 |
-
"bytes":
|
| 193 |
-
"sha256": "
|
| 194 |
}
|
| 195 |
}
|
| 196 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"files": {
|
| 3 |
"README.md": {
|
| 4 |
+
"bytes": 1033,
|
| 5 |
+
"sha256": "4788fd92c347b0f30ec74e278f1c8d24e91eea0e1fd6106178bb29876e0bc4bd"
|
| 6 |
},
|
| 7 |
"SOURCE_LOCK.json": {
|
| 8 |
+
"bytes": 332,
|
| 9 |
+
"sha256": "a3f67ba6d525a1fdffbc87093b0a2b4ee12b7c482b95050dfd7b27b09d19143d"
|
| 10 |
},
|
| 11 |
+
"components/qemedia/.dockerignore": {
|
| 12 |
"bytes": 29,
|
| 13 |
"sha256": "60c9bdd905fcf45ac485c680d32e9773962cf061b6f041dcddd033911558a672"
|
| 14 |
},
|
| 15 |
+
"components/qemedia/ADAPTER_NOTICE": {
|
| 16 |
+
"bytes": 301,
|
| 17 |
+
"sha256": "5991dc74fa45e42c24120d3ddf4fd39c92f908f44986c71cf658c5b12deda80b"
|
| 18 |
},
|
| 19 |
+
"components/qemedia/Dockerfile": {
|
| 20 |
+
"bytes": 978,
|
| 21 |
+
"sha256": "0edae3727291af6b7ed7b3d38bf94d4aaa2c42c01c4d748d676ef9045de1c8df"
|
| 22 |
},
|
| 23 |
+
"components/qemedia/LICENSE": {
|
| 24 |
+
"bytes": 1074,
|
| 25 |
+
"sha256": "e0a8e97900a1184396b65bca8507d5c7b1a6df58537b61722dfe0f416990f0e2"
|
| 26 |
},
|
| 27 |
+
"components/qemedia/README.md": {
|
| 28 |
+
"bytes": 293,
|
| 29 |
+
"sha256": "1f6d860d8285f6297e5381c08925a1ece2bf88eb5b0344b10740269e222a060d"
|
| 30 |
},
|
| 31 |
+
"components/qemedia/SOURCE_MANIFEST.json": {
|
| 32 |
+
"bytes": 11903,
|
| 33 |
+
"sha256": "f97c7ed6f032ebf9e6276f6156c447a2f128739858fc243143d72b86443292f3"
|
| 34 |
},
|
| 35 |
+
"components/qemedia/THIRD_PARTY_NOTICES": {
|
| 36 |
+
"bytes": 4448,
|
| 37 |
+
"sha256": "755b9132babde91fb34bf29a7759c3cead1299484335fcafdb057fd207f210b8"
|
| 38 |
},
|
| 39 |
+
"components/qemedia/UPSTREAM_DOCKERFILE": {
|
| 40 |
+
"bytes": 2415,
|
| 41 |
+
"sha256": "acb6b642cd8d1c4f66e8a82a2cc97c9d4643ca484422e225505c0ea2b739e146"
|
| 42 |
},
|
| 43 |
+
"components/qemedia/runtime/qemedia_compat/__init__.py": {
|
| 44 |
+
"bytes": 66,
|
| 45 |
+
"sha256": "bd90e5f33d8c325c978e826c5e7a73e4ad73ff535f367ddfed0dec3d52470ade"
|
| 46 |
},
|
| 47 |
+
"components/qemedia/runtime/qemedia_compat/environment.py": {
|
| 48 |
+
"bytes": 7410,
|
| 49 |
+
"sha256": "0fbea553dc22fa2fd72a4590c2c008eeefaa4af5654a2e9936465c18c79c9149"
|
| 50 |
},
|
| 51 |
+
"components/qemedia/runtime/qemedia_compat/server.py": {
|
| 52 |
+
"bytes": 543,
|
| 53 |
+
"sha256": "1d41688c822b842c70f32502d627c252fcd3526c7be74d6880f2f86d06df981a"
|
| 54 |
},
|
| 55 |
+
"components/qemedia/upstream/qe_arena/__init__.py": {
|
| 56 |
+
"bytes": 72,
|
| 57 |
+
"sha256": "f1ce27b1c58f9547059e7f820aa65c1a8d8313144855ee8845b2eca91f7e0db3"
|
| 58 |
+
},
|
| 59 |
+
"components/qemedia/upstream/qe_arena/app.py": {
|
| 60 |
+
"bytes": 791,
|
| 61 |
+
"sha256": "2925e44219fdef6310ac1e2b60532e3ba1f1e768b33e65f14f1f5e8f86b33510"
|
| 62 |
+
},
|
| 63 |
+
"components/qemedia/upstream/qe_arena/corpus/__init__.py": {
|
| 64 |
+
"bytes": 5497,
|
| 65 |
+
"sha256": "978aabadc5044616ff28ab7be69a2e9ff48f1fd82494a6897f4f2b8716283a08"
|
| 66 |
+
},
|
| 67 |
+
"components/qemedia/upstream/qe_arena/corpus/aggregate_risk_factors.py": {
|
| 68 |
+
"bytes": 2512,
|
| 69 |
+
"sha256": "0485dfbc2676a1f666958935602cc2f347e5fcd95b6bfcd32e8af13cafe07e35"
|
| 70 |
+
},
|
| 71 |
+
"components/qemedia/upstream/qe_arena/corpus/alternate_chat_roles.py": {
|
| 72 |
+
"bytes": 2402,
|
| 73 |
+
"sha256": "f999a088228120810c986f249964ba83d7a54a4853c9bebcbf61313b4362247e"
|
| 74 |
+
},
|
| 75 |
+
"components/qemedia/upstream/qe_arena/corpus/amortization_schedule.py": {
|
| 76 |
+
"bytes": 2769,
|
| 77 |
+
"sha256": "4b4f6e1280956988736c2401747ed0c3d633eedfe38e7d24ec815773f5c21711"
|
| 78 |
+
},
|
| 79 |
+
"components/qemedia/upstream/qe_arena/corpus/api_complexity_level.py": {
|
| 80 |
+
"bytes": 2122,
|
| 81 |
+
"sha256": "21517da739674bdc2b22efe9c2a2a7a85d47a7033aae3e24b2c1da8b4ac21684"
|
| 82 |
+
},
|
| 83 |
+
"components/qemedia/upstream/qe_arena/corpus/artifact_retention_keep.py": {
|
| 84 |
+
"bytes": 2817,
|
| 85 |
+
"sha256": "71db4461633e0ad524e11c2384d75675331a515778ce4a8b675c6f738c94a02c"
|
| 86 |
+
},
|
| 87 |
+
"components/qemedia/upstream/qe_arena/corpus/backoff_schedule.py": {
|
| 88 |
+
"bytes": 2091,
|
| 89 |
+
"sha256": "1f1937c25f4717a49a6e809ea81cc20da035f6aa843d4f47ce111b585e3ab4a2"
|
| 90 |
+
},
|
| 91 |
+
"components/qemedia/upstream/qe_arena/corpus/badge_dimensions.py": {
|
| 92 |
+
"bytes": 2054,
|
| 93 |
+
"sha256": "2661b8a01fb4d7d1a31169592eaae370b3d4260d6b32187ce4427ffbcfa097ea"
|
| 94 |
+
},
|
| 95 |
+
"components/qemedia/upstream/qe_arena/corpus/baseline_verdict.py": {
|
| 96 |
+
"bytes": 2121,
|
| 97 |
+
"sha256": "b1d44ea5c1b774f8572374e73468ca34483e3b382c982c28a368549da94656d5"
|
| 98 |
+
},
|
| 99 |
+
"components/qemedia/upstream/qe_arena/corpus/booking_conflicts.py": {
|
| 100 |
+
"bytes": 2577,
|
| 101 |
+
"sha256": "01764d4994630e38a91a6599f90142a9b145084dbd5971c564727ac9855f97f8"
|
| 102 |
+
},
|
| 103 |
+
"components/qemedia/upstream/qe_arena/corpus/boundary_violations.py": {
|
| 104 |
+
"bytes": 4373,
|
| 105 |
+
"sha256": "7f70d489eefbdae5794354fa457a39dc50eb0209929cb0f3a9f9493b41adc88a"
|
| 106 |
+
},
|
| 107 |
+
"components/qemedia/upstream/qe_arena/corpus/brace_delta.py": {
|
| 108 |
+
"bytes": 1937,
|
| 109 |
+
"sha256": "04d411ac8a666d3916c13090c7658e5cc516028ced9b0db45a334062d96683c5"
|
| 110 |
+
},
|
| 111 |
+
"components/qemedia/upstream/qe_arena/corpus/calibration_fit.py": {
|
| 112 |
+
"bytes": 2530,
|
| 113 |
+
"sha256": "6f0982869b0ef19ec7b95863008ea45b1a46dbd46108ee24b44338a383a37d23"
|
| 114 |
+
},
|
| 115 |
+
"components/qemedia/upstream/qe_arena/corpus/chat_completion_result.py": {
|
| 116 |
+
"bytes": 4015,
|
| 117 |
+
"sha256": "42b4727623069a0e774e0d70be6cb9869d871b377ddb6421c60bfa78bd3be126"
|
| 118 |
+
},
|
| 119 |
+
"components/qemedia/upstream/qe_arena/corpus/claim_steal_priority.py": {
|
| 120 |
+
"bytes": 2528,
|
| 121 |
+
"sha256": "f5c6486256438b89565cc1edcaf016d6e91f3c81067a77a30c9792cac7d0ef39"
|
| 122 |
+
},
|
| 123 |
+
"components/qemedia/upstream/qe_arena/corpus/compare_versions.py": {
|
| 124 |
+
"bytes": 2384,
|
| 125 |
+
"sha256": "a77352fd67a18a9c24c3fe697c9310b079c998dc853c2f49eba1a2c877742a62"
|
| 126 |
+
},
|
| 127 |
+
"components/qemedia/upstream/qe_arena/corpus/complexity_bucket.py": {
|
| 128 |
+
"bytes": 2333,
|
| 129 |
+
"sha256": "5e4e65b458e8cd2e9723206e43ea3a85d37df8b82c9f15e19f4da5ce26dd72ff"
|
| 130 |
+
},
|
| 131 |
+
"components/qemedia/upstream/qe_arena/corpus/compound_interest.py": {
|
| 132 |
+
"bytes": 2693,
|
| 133 |
+
"sha256": "3979785d451cc4473ec2b057a404f0a8ea930bd11ce34bedea06f1b953ee9c08"
|
| 134 |
+
},
|
| 135 |
+
"components/qemedia/upstream/qe_arena/corpus/convert_timecode.py": {
|
| 136 |
+
"bytes": 2696,
|
| 137 |
+
"sha256": "30ff0142461a624790a13766f9463c6fd6f21991442e5e37d46febd51f2ca7ad"
|
| 138 |
+
},
|
| 139 |
+
"components/qemedia/upstream/qe_arena/corpus/coverage_gap_severity.py": {
|
| 140 |
+
"bytes": 2027,
|
| 141 |
+
"sha256": "af3e694760997b353678c7350b08e43ed26de256792221420006e5d4837712d5"
|
| 142 |
+
},
|
| 143 |
+
"components/qemedia/upstream/qe_arena/corpus/crop_to_aspect.py": {
|
| 144 |
+
"bytes": 2252,
|
| 145 |
+
"sha256": "f85c6167be7fe0094e36b90d19fb4e382a2e804a34dc96fa09f379caf97d5904"
|
| 146 |
+
},
|
| 147 |
+
"components/qemedia/upstream/qe_arena/corpus/debounce_switch.py": {
|
| 148 |
+
"bytes": 2416,
|
| 149 |
+
"sha256": "61e8975cc643b0bd4d10656d48a77a7314b5e13382794bdcbecf19f2a80b3186"
|
| 150 |
+
},
|
| 151 |
+
"components/qemedia/upstream/qe_arena/corpus/decay_table.py": {
|
| 152 |
+
"bytes": 2553,
|
| 153 |
+
"sha256": "949197b79f96f244ccba1b44236510ec65d8c9aace59850cde4949697791024f"
|
| 154 |
+
},
|
| 155 |
+
"components/qemedia/upstream/qe_arena/corpus/efficiency_reward.py": {
|
| 156 |
+
"bytes": 2167,
|
| 157 |
+
"sha256": "c5033c7d0a147c46e9cf1659187879b00e8f253725f1fcc00b6c4e5529c9685b"
|
| 158 |
+
},
|
| 159 |
+
"components/qemedia/upstream/qe_arena/corpus/expense_violations.py": {
|
| 160 |
+
"bytes": 2567,
|
| 161 |
+
"sha256": "11d505901f9d2e00cc5b475d9cca75b4770db77345c1645b10e70620710a70b0"
|
| 162 |
+
},
|
| 163 |
+
"components/qemedia/upstream/qe_arena/corpus/find_stop.py": {
|
| 164 |
+
"bytes": 2930,
|
| 165 |
+
"sha256": "284d4fcd6c5cb23efc4282659991d9a403b46c0d836641071ad7079d8d2c8d0d"
|
| 166 |
+
},
|
| 167 |
+
"components/qemedia/upstream/qe_arena/corpus/flakiness_pattern.py": {
|
| 168 |
+
"bytes": 2283,
|
| 169 |
+
"sha256": "b3b94bcfe78f97b00187e7fe9783a8ae04b9a9b6af6d788f445f64bd52021aa0"
|
| 170 |
+
},
|
| 171 |
+
"components/qemedia/upstream/qe_arena/corpus/flaky_hunter_reward.py": {
|
| 172 |
"bytes": 1941,
|
| 173 |
+
"sha256": "11c670fbe537cbeeaa101d9b9db49519f5ebd4cca82b7ccfd66d5d68e352e5ba"
|
| 174 |
+
},
|
| 175 |
+
"components/qemedia/upstream/qe_arena/corpus/flaky_run_summary.py": {
|
| 176 |
+
"bytes": 2235,
|
| 177 |
+
"sha256": "f6ebbaffe1dd8aaccef7ad8ce48d8dfa60bacc8a44051880057c52b163e7748b"
|
| 178 |
+
},
|
| 179 |
+
"components/qemedia/upstream/qe_arena/corpus/format_duration.py": {
|
| 180 |
+
"bytes": 1843,
|
| 181 |
+
"sha256": "7e0cf537d1bd38fdbc474bc259a52fbf23f095f35661586d771eca0561481eb0"
|
| 182 |
+
},
|
| 183 |
+
"components/qemedia/upstream/qe_arena/corpus/gguf_loader.py": {
|
| 184 |
+
"bytes": 4031,
|
| 185 |
+
"sha256": "e232fbfe97a36cedf848caa11b9bf51828c5f4c6fe6ad3bf40133c6bc7deabd7"
|
| 186 |
+
},
|
| 187 |
+
"components/qemedia/upstream/qe_arena/corpus/gguf_special_ids.py": {
|
| 188 |
+
"bytes": 4671,
|
| 189 |
+
"sha256": "b5fc54e4b3f6b45af2af289a746fe48d948e806b43910920e6ee31c81bbd805e"
|
| 190 |
+
},
|
| 191 |
+
"components/qemedia/upstream/qe_arena/corpus/glob_match.py": {
|
| 192 |
+
"bytes": 2785,
|
| 193 |
+
"sha256": "52d8da6da1348af21303785a5dabfe36a42f7efeaed9b326b21898387a3e6536"
|
| 194 |
+
},
|
| 195 |
+
"components/qemedia/upstream/qe_arena/corpus/income_tax.py": {
|
| 196 |
+
"bytes": 2997,
|
| 197 |
+
"sha256": "ce28e349ed362052dd0184dc4f1e215344831edc2f74ebe8438c470964fc70a3"
|
| 198 |
+
},
|
| 199 |
+
"components/qemedia/upstream/qe_arena/corpus/integer_edge_values.py": {
|
| 200 |
+
"bytes": 2422,
|
| 201 |
+
"sha256": "edd468fbc9d11830559fbcc2bfb1d7afe35c71980432bb91c87d8c3571a704b7"
|
| 202 |
+
},
|
| 203 |
+
"components/qemedia/upstream/qe_arena/corpus/ip_allowlist_match.py": {
|
| 204 |
+
"bytes": 3267,
|
| 205 |
+
"sha256": "94bc28736f587e3cc350fef83ba95fe70dc44db627bcb037f854332f6b52e7fd"
|
| 206 |
+
},
|
| 207 |
+
"components/qemedia/upstream/qe_arena/corpus/is_collection_endpoint.py": {
|
| 208 |
+
"bytes": 2344,
|
| 209 |
+
"sha256": "87db0af0b61c0b95b0d8acf9235835db9631f9471d0e7dc29b0296abc76bccde"
|
| 210 |
+
},
|
| 211 |
+
"components/qemedia/upstream/qe_arena/corpus/latency_percentiles.py": {
|
| 212 |
+
"bytes": 2250,
|
| 213 |
+
"sha256": "7d91f4eb06374851748cbd3e33ae5f3d2059a491572449d4fc700ecaaed1431c"
|
| 214 |
+
},
|
| 215 |
+
"components/qemedia/upstream/qe_arena/corpus/login_rate_limit.py": {
|
| 216 |
+
"bytes": 2464,
|
| 217 |
+
"sha256": "814fc40372c1ece5068b04848f9c8a2a9069d504cf364df62c00a905d0ec777c"
|
| 218 |
+
},
|
| 219 |
+
"components/qemedia/upstream/qe_arena/corpus/loudness_gain.py": {
|
| 220 |
+
"bytes": 2668,
|
| 221 |
+
"sha256": "ecc262d19d2b27970901017aa4a006ad2ce97861866ccddae2a9c876c4bbec37"
|
| 222 |
+
},
|
| 223 |
+
"components/qemedia/upstream/qe_arena/corpus/mail_merge.py": {
|
| 224 |
+
"bytes": 2873,
|
| 225 |
+
"sha256": "2c3ec2cb2f5e050ff03d772675c372053fe3eb957f505a33d2d127916ee283bf"
|
| 226 |
+
},
|
| 227 |
+
"components/qemedia/upstream/qe_arena/corpus/maintainability_index.py": {
|
| 228 |
+
"bytes": 1856,
|
| 229 |
+
"sha256": "48972588b8f75f1132aaf0eaa112a35875833b7dc661e3c41ff6972f3ce29dd5"
|
| 230 |
+
},
|
| 231 |
+
"components/qemedia/upstream/qe_arena/corpus/maintenance_status.py": {
|
| 232 |
+
"bytes": 2875,
|
| 233 |
+
"sha256": "201bad40ff156e6a0caec2577011286262178000435aacaec83c603ba02aa4f8"
|
| 234 |
+
},
|
| 235 |
+
"components/qemedia/upstream/qe_arena/corpus/merge_intervals.py": {
|
| 236 |
+
"bytes": 2602,
|
| 237 |
+
"sha256": "fd5b0f08e59fc763734cdb43d4cd893ce851403281a806902f5945ce71e7e7cd"
|
| 238 |
+
},
|
| 239 |
+
"components/qemedia/upstream/qe_arena/corpus/mod_inverse.py": {
|
| 240 |
+
"bytes": 1845,
|
| 241 |
+
"sha256": "888558da6833e82d1b2dafadf39aa87609cf5c4bcc96345a4e37ac92cfd1d0de"
|
| 242 |
+
},
|
| 243 |
+
"components/qemedia/upstream/qe_arena/corpus/mod_pow.py": {
|
| 244 |
+
"bytes": 1729,
|
| 245 |
+
"sha256": "58cdc61459945cdd9bf20ab09cfa422c85148d76fecfc70567ef81b1240c2f36"
|
| 246 |
+
},
|
| 247 |
+
"components/qemedia/upstream/qe_arena/corpus/networkdays.py": {
|
| 248 |
+
"bytes": 2293,
|
| 249 |
+
"sha256": "1c72218af8a816d24fc7ba7d88901c83db49c056da34efea5f2ba491a77493d2"
|
| 250 |
+
},
|
| 251 |
+
"components/qemedia/upstream/qe_arena/corpus/normalize_rational.py": {
|
| 252 |
+
"bytes": 2629,
|
| 253 |
+
"sha256": "62e849358e01be48618529568005a1b487b411bdc18a01b4c226b824f77320df"
|
| 254 |
+
},
|
| 255 |
+
"components/qemedia/upstream/qe_arena/corpus/parse_cron_field.py": {
|
| 256 |
+
"bytes": 3288,
|
| 257 |
+
"sha256": "6275cc4556df344a4dfccbcdf5930e9561bcb27b93fcb247c9707a84c48f3231"
|
| 258 |
+
},
|
| 259 |
+
"components/qemedia/upstream/qe_arena/corpus/parse_max_age.py": {
|
| 260 |
+
"bytes": 1593,
|
| 261 |
+
"sha256": "52df1c52ecfe9db206a6322350204d2bbbaeb2fe6bd192d8b98d56de8739bf50"
|
| 262 |
+
},
|
| 263 |
+
"components/qemedia/upstream/qe_arena/corpus/parse_signature_header.py": {
|
| 264 |
+
"bytes": 2405,
|
| 265 |
+
"sha256": "cf81c249d3ff4092557d20bdcf210ce52cbe4c9e2e5e8634d279a46568d2f4df"
|
| 266 |
+
},
|
| 267 |
+
"components/qemedia/upstream/qe_arena/corpus/password_violations.py": {
|
| 268 |
+
"bytes": 3045,
|
| 269 |
+
"sha256": "5d1a27cea4b7db6b2b2484015dfc73e61ddc04b3d021da8adfb1788ebf0dd54c"
|
| 270 |
+
},
|
| 271 |
+
"components/qemedia/upstream/qe_arena/corpus/pattern_effectiveness.py": {
|
| 272 |
+
"bytes": 2379,
|
| 273 |
+
"sha256": "ccf4a9d4183523e3b82f95cf0f5f18efe86881ece0d7274f24f5236233aa4f13"
|
| 274 |
+
},
|
| 275 |
+
"components/qemedia/upstream/qe_arena/corpus/pressure_check.py": {
|
| 276 |
+
"bytes": 3417,
|
| 277 |
+
"sha256": "c7b17812aa575ee19db876d526f0770ad6ee591e6aa2bc624e05527cc1ef7df2"
|
| 278 |
+
},
|
| 279 |
+
"components/qemedia/upstream/qe_arena/corpus/quality_gain_reward.py": {
|
| 280 |
+
"bytes": 2028,
|
| 281 |
+
"sha256": "cca54e5fa4dfed47ac23f06111a357fb1a2f9fbd3b29a8d9873d268a91a754ec"
|
| 282 |
+
},
|
| 283 |
+
"components/qemedia/upstream/qe_arena/corpus/quality_grade.py": {
|
| 284 |
+
"bytes": 2115,
|
| 285 |
+
"sha256": "aafb0bab705f85093cecdfa13bdce9a1f23bbf055b60f50783abc46f020b8fef"
|
| 286 |
+
},
|
| 287 |
+
"components/qemedia/upstream/qe_arena/corpus/reconcile_invoices.py": {
|
| 288 |
+
"bytes": 3579,
|
| 289 |
+
"sha256": "169e88a7162bc1e2a798b76ee491191ca44fca3051d7eb392b56b7672139142e"
|
| 290 |
+
},
|
| 291 |
+
"components/qemedia/upstream/qe_arena/corpus/round_sig_figs.py": {
|
| 292 |
+
"bytes": 2350,
|
| 293 |
+
"sha256": "361cbe3b3c5e2da8317b2cf703dc11405d4c10ad2d62551c65388028238f4fb5"
|
| 294 |
+
},
|
| 295 |
+
"components/qemedia/upstream/qe_arena/corpus/safe_join.py": {
|
| 296 |
+
"bytes": 2508,
|
| 297 |
+
"sha256": "368365c0bd5b318b63d1614caba8bd4f752011f6beecf3ede4fbb42f137441d7"
|
| 298 |
+
},
|
| 299 |
+
"components/qemedia/upstream/qe_arena/corpus/sample_variance.py": {
|
| 300 |
+
"bytes": 1906,
|
| 301 |
+
"sha256": "a26bc6ef76d5dfbc4b0abff3f0189f6bd181f6934bcb6dee3410ab752316223d"
|
| 302 |
+
},
|
| 303 |
+
"components/qemedia/upstream/qe_arena/corpus/select_bitrate_rung.py": {
|
| 304 |
+
"bytes": 2366,
|
| 305 |
+
"sha256": "51ae093e2baeda053434e2e223827384124290ed5317bf160f0b3df366ef02eb"
|
| 306 |
+
},
|
| 307 |
+
"components/qemedia/upstream/qe_arena/corpus/shift_cue.py": {
|
| 308 |
+
"bytes": 2795,
|
| 309 |
+
"sha256": "cce40f8f9266e58918b174e82d1b167523a4df1b78a53f07af06fe43d9c9100e"
|
| 310 |
+
},
|
| 311 |
+
"components/qemedia/upstream/qe_arena/corpus/slew_limit.py": {
|
| 312 |
+
"bytes": 2885,
|
| 313 |
+
"sha256": "540a4e6c04b1e3cc78cf69e42897d6680840c513ffcc86eeba8f2aa735d30cf6"
|
| 314 |
+
},
|
| 315 |
+
"components/qemedia/upstream/qe_arena/corpus/spec_readiness_score.py": {
|
| 316 |
+
"bytes": 4578,
|
| 317 |
+
"sha256": "02936fcc7e5931cad5a46b286d098ae2d34698449f2eaa190eaa44f9785543da"
|
| 318 |
+
},
|
| 319 |
+
"components/qemedia/upstream/qe_arena/corpus/split_generic_params.py": {
|
| 320 |
+
"bytes": 2201,
|
| 321 |
+
"sha256": "9188e0c8045fa0d8e1a7a82153f6ccc791e075dd7a6f3b793abd117bb1064275"
|
| 322 |
+
},
|
| 323 |
+
"components/qemedia/upstream/qe_arena/corpus/streamable_len.py": {
|
| 324 |
+
"bytes": 3235,
|
| 325 |
+
"sha256": "d3aac59af147f657bbe61bb45e368d78cee587be7a4fa58208410fd5a9e3d26c"
|
| 326 |
+
},
|
| 327 |
+
"components/qemedia/upstream/qe_arena/corpus/string_length_boundaries.py": {
|
| 328 |
+
"bytes": 2253,
|
| 329 |
+
"sha256": "62a7ac1680df0375cae8ecb6cf08a3520375cb9c8dea94299a30551d0abe479e"
|
| 330 |
+
},
|
| 331 |
+
"components/qemedia/upstream/qe_arena/corpus/threshold_compliance.py": {
|
| 332 |
+
"bytes": 4277,
|
| 333 |
+
"sha256": "13361068ea0f1ebaacadb264bfec120e990341cf66154f77a1a110777be1754e"
|
| 334 |
+
},
|
| 335 |
+
"components/qemedia/upstream/qe_arena/corpus/token_claims_check.py": {
|
| 336 |
+
"bytes": 3488,
|
| 337 |
+
"sha256": "081ef70cde049750026cc4f60794f46a74a86424c12d73ea5c278b19563b2e77"
|
| 338 |
},
|
| 339 |
+
"components/qemedia/upstream/qe_arena/corpus/token_jaccard.py": {
|
| 340 |
+
"bytes": 1948,
|
| 341 |
+
"sha256": "9d10c0da4d0375ea05c99d0e5d2dd57a4bedf1a4fa5a5f48d6cc9344177f19bb"
|
| 342 |
},
|
| 343 |
+
"components/qemedia/upstream/qe_arena/corpus/trace_sampling_decision.py": {
|
| 344 |
+
"bytes": 2874,
|
| 345 |
+
"sha256": "6e20c250fb2d01cf06ed5b099d67089f43f7851e90224399f5865aee539d4f32"
|
| 346 |
},
|
| 347 |
+
"components/qemedia/upstream/qe_arena/corpus/truncate_to_token_budget.py": {
|
| 348 |
+
"bytes": 2451,
|
| 349 |
+
"sha256": "5246d62082d3a37dd57e6d3510ea489a4de4c44a31e5bddb2d4d438817b0c43b"
|
| 350 |
},
|
| 351 |
+
"components/qemedia/upstream/qe_arena/corpus/uncovered_line_ranges.py": {
|
| 352 |
+
"bytes": 1864,
|
| 353 |
+
"sha256": "9feb8f950e2cff5904eddba37a15e16a8888a7cb8f5dc893e74808a36c6f1876"
|
| 354 |
},
|
| 355 |
+
"components/qemedia/upstream/qe_arena/corpus/validate_csv_row.py": {
|
| 356 |
+
"bytes": 2764,
|
| 357 |
+
"sha256": "bc332a39e0143f24ee326b0f9343150a22f47fa420dc29ecf1cba816385a1d43"
|
| 358 |
},
|
| 359 |
+
"components/qemedia/upstream/qe_arena/corpus/vuln_priority_bucket.py": {
|
| 360 |
+
"bytes": 1889,
|
| 361 |
+
"sha256": "3132a4152e1baf9061b0e70d3192e0617e8de735195eb560dcfee5011c14f6fc"
|
| 362 |
},
|
| 363 |
+
"components/qemedia/upstream/qe_arena/corpus/wilson_interval.py": {
|
| 364 |
+
"bytes": 1922,
|
| 365 |
+
"sha256": "28e98e2f9b24bb36171fa2f5c5c9d78be23e193615b265aad092bec771eb8021"
|
| 366 |
},
|
| 367 |
+
"components/qemedia/upstream/qe_arena/domains.py": {
|
| 368 |
+
"bytes": 1191,
|
| 369 |
+
"sha256": "13bb7b068896d5377b8f969c504dde01875df8eef8a0b341348e45bcea5f991b"
|
| 370 |
},
|
| 371 |
+
"components/qemedia/upstream/qe_arena/edit_budget.py": {
|
| 372 |
+
"bytes": 28000,
|
| 373 |
+
"sha256": "4b27436ca7c4eed5e7dda34ccfac6c97eb413cf024274793d4d1cf47b50f9494"
|
| 374 |
},
|
| 375 |
+
"components/qemedia/upstream/qe_arena/environment.py": {
|
| 376 |
+
"bytes": 10774,
|
| 377 |
+
"sha256": "9675b6598456b5a8dbfe57eb6e6847998d86f2c93722caff3c8a3716d6ecc102"
|
| 378 |
},
|
| 379 |
+
"components/qemedia/upstream/qe_arena/flaky.py": {
|
| 380 |
+
"bytes": 22246,
|
| 381 |
+
"sha256": "0db273642496825ec8f8924a164093df1191b29c92ac83b5497261373c20f768"
|
| 382 |
},
|
| 383 |
+
"components/qemedia/upstream/qe_arena/flaky_gen.py": {
|
| 384 |
+
"bytes": 13599,
|
| 385 |
+
"sha256": "46e2198bcbe9d415bf775f845a358c2eaa26d390a5aa62d3b806f07b5803fab1"
|
| 386 |
},
|
| 387 |
+
"components/qemedia/upstream/qe_arena/flaky_templates.py": {
|
| 388 |
+
"bytes": 19057,
|
| 389 |
+
"sha256": "2272e0617a3a079d2e389bf50d62c4cc5da4ec005d2d68239bdfbf7e795fda92"
|
| 390 |
},
|
| 391 |
+
"components/qemedia/upstream/qe_arena/guest_harness.py": {
|
| 392 |
+
"bytes": 13974,
|
| 393 |
+
"sha256": "5b389cc8ab64218d3bdcc500f584ef0b78da4b68379bfb014e095d755ccdcdb1"
|
| 394 |
},
|
| 395 |
+
"components/qemedia/upstream/qe_arena/keys/manifest_ed25519.pub": {
|
| 396 |
+
"bytes": 113,
|
| 397 |
+
"sha256": "ea2b370db92d82e1a0719ecf3416eeafdb7a14a524a94f6d6cd32a5f06b21106"
|
| 398 |
},
|
| 399 |
+
"components/qemedia/upstream/qe_arena/manifest.py": {
|
| 400 |
+
"bytes": 6932,
|
| 401 |
+
"sha256": "1911ef5d3696695364871da7be9744fd7c81d51fe81ae3c137341dd1b06c8494"
|
| 402 |
},
|
| 403 |
+
"components/qemedia/upstream/qe_arena/mutation.py": {
|
| 404 |
+
"bytes": 43554,
|
| 405 |
+
"sha256": "28a7abc5213c5a1504151d23148695e7f09e4441b39e941377cb7265ba6ff4de"
|
| 406 |
},
|
| 407 |
+
"components/qemedia/upstream/qe_arena/runtime_pins.json": {
|
| 408 |
+
"bytes": 179,
|
| 409 |
+
"sha256": "97f080e2505ba4c6034fcc3f0322d9ecd8b9f9852ac19e424cc9273ccd0a9c77"
|
| 410 |
},
|
| 411 |
+
"components/qemedia/upstream/qe_arena/sandbox.py": {
|
| 412 |
+
"bytes": 34230,
|
| 413 |
+
"sha256": "92faaac323c0b524c0181008c305134fc57d2e4c6af1ea6fbf919b48ec9ea03a"
|
| 414 |
},
|
| 415 |
+
"components/qemedia/upstream/qe_arena/shell.py": {
|
| 416 |
+
"bytes": 26494,
|
| 417 |
+
"sha256": "4e9aabefa6f23793a05804ec413aaa5d1c5125365156f22cdb50ff600808d34d"
|
| 418 |
},
|
| 419 |
+
"components/qemedia/upstream/qe_arena/skills/__init__.py": {
|
| 420 |
+
"bytes": 6616,
|
| 421 |
+
"sha256": "c6b045c7b62b762ae4a56b13fcc61bf997ffd710494f9882e775f533dfe8c522"
|
| 422 |
},
|
| 423 |
+
"components/qemedia/upstream/qe_arena/skills/_common.py": {
|
| 424 |
+
"bytes": 1640,
|
| 425 |
+
"sha256": "ec722ad0aa0903fbca443dc8325f2569853b7191edfc525602d3cd0ddaf56037"
|
| 426 |
},
|
| 427 |
+
"components/qemedia/upstream/qe_arena/skills/formal.py": {
|
| 428 |
+
"bytes": 24536,
|
| 429 |
+
"sha256": "da87595287e1d253512564769274e3063f262fce0d4d4ea0ef5b26d9285a72e0"
|
| 430 |
},
|
| 431 |
+
"components/qemedia/upstream/qe_arena/skills/media.py": {
|
| 432 |
+
"bytes": 18987,
|
| 433 |
+
"sha256": "005eabea342ba948e6b68dcc341f3756a8ebdd5fb44830cb13bb482a16ef200c"
|
| 434 |
},
|
| 435 |
+
"components/qemedia/upstream/qe_arena/skills/science.py": {
|
| 436 |
+
"bytes": 23268,
|
| 437 |
+
"sha256": "f198046eb6e9d0610cd966f5e7a99d27e9da2e3f23e3687ecd42f4a5649aab98"
|
| 438 |
},
|
| 439 |
+
"components/qemedia/upstream/qe_arena/skills/subtitles.py": {
|
| 440 |
+
"bytes": 8058,
|
| 441 |
+
"sha256": "872054f7309500113beab2c853bfeceebd146e60dc36d42f42f9e98e6c4a7b84"
|
| 442 |
},
|
| 443 |
+
"components/qemedia/upstream/qe_arena/tasks.py": {
|
| 444 |
+
"bytes": 29386,
|
| 445 |
+
"sha256": "c540dc8eafd3ac648f768b17682ecb1f8f3bd3e14eed9a353c4021c427dc80bd"
|
| 446 |
},
|
| 447 |
+
"components/qemedia/upstream/qe_arena/terminal_app.py": {
|
| 448 |
+
"bytes": 801,
|
| 449 |
+
"sha256": "d5a630210e1a8330ec3cc00a5b43d7d92b110a6d0eb8ec5e83d3bba13e85fcc0"
|
| 450 |
},
|
| 451 |
+
"components/qemedia/upstream/qe_arena/terminal_env.py": {
|
| 452 |
+
"bytes": 11168,
|
| 453 |
+
"sha256": "6ea5cfcffc292e52ead2687728ad6d9c040dfaf32a5610386ac6514d4b1438b3"
|
| 454 |
},
|
| 455 |
+
"components/qemedia/upstream/qe_arena/wasi_fs.py": {
|
| 456 |
+
"bytes": 14300,
|
| 457 |
+
"sha256": "71f35970518b637bfa50fa79897d6f79d065e4531211af402f91a9dba4d31f38"
|
| 458 |
},
|
| 459 |
+
"components/qemedia/upstream/qe_arena/wasi_worker.py": {
|
| 460 |
+
"bytes": 17237,
|
| 461 |
+
"sha256": "6e81b271a5910977f38deba39ccde6465d70e23e9ed42cbec51f02a6e237c71e"
|
| 462 |
},
|
| 463 |
"schema.json": {
|
| 464 |
+
"bytes": 2557,
|
| 465 |
+
"sha256": "c486d87e05b69ab133dd04cba072d5a39de8fda53c9a2f6fd5995570384724b0"
|
| 466 |
},
|
| 467 |
"tasks.jsonl": {
|
| 468 |
+
"bytes": 2738,
|
| 469 |
+
"sha256": "7e16aa89ecd785fe76b4c3b1ef887845d33dbf293a849578a02efafb0da92c00"
|
| 470 |
},
|
| 471 |
"validate_dataset.py": {
|
| 472 |
+
"bytes": 11813,
|
| 473 |
+
"sha256": "3ab9912b176d4555f7d38828bd66854b60311dc42c2e25c665cb8296fffaf9db"
|
| 474 |
}
|
| 475 |
}
|
| 476 |
}
|
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
-
license:
|
| 5 |
task_categories:
|
| 6 |
- reinforcement-learning
|
| 7 |
configs:
|
|
@@ -11,10 +11,10 @@ configs:
|
|
| 11 |
path: tasks.jsonl
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
Run one
|
| 19 |
|
| 20 |
-
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: mit
|
| 5 |
task_categories:
|
| 6 |
- reinforcement-learning
|
| 7 |
configs:
|
|
|
|
| 11 |
path: tasks.jsonl
|
| 12 |
---
|
| 13 |
|
| 14 |
+
Two original QE media task cells cover timecode arithmetic, catalogue normalization, crop dimensions and subtitle retiming.
|
| 15 |
|
| 16 |
+
Reset with `task_id` set to `qe_skill-media-d2` or `qe_skill-media-d1`. An explicit seed reproduces the original instance; omitting it draws a fresh instance. Use the native `action_type` values `exec`, `write_file` and `evaluate`. Reward is one when all original checks on the output artifact pass, otherwise zero.
|
| 17 |
|
| 18 |
+
Run one active session per fresh sandbox. Episodes allow 32 actions, 4096 completion tokens and 8192 context tokens. Observations after reset count toward completion tokens. Commands have the original 30-second limit.
|
| 19 |
|
| 20 |
+
Pinned source and task metadata are in `tasks.jsonl` and `components/qemedia/`. Original modules and their import dependencies are included. Run `python3 -B validate_dataset.py` to verify the file inventory.
|
SHA256SUMS
CHANGED
|
@@ -1,48 +1,118 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
60c9bdd905fcf45ac485c680d32e9773962cf061b6f041dcddd033911558a672 components/
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
4788fd92c347b0f30ec74e278f1c8d24e91eea0e1fd6106178bb29876e0bc4bd README.md
|
| 2 |
+
a3f67ba6d525a1fdffbc87093b0a2b4ee12b7c482b95050dfd7b27b09d19143d SOURCE_LOCK.json
|
| 3 |
+
60c9bdd905fcf45ac485c680d32e9773962cf061b6f041dcddd033911558a672 components/qemedia/.dockerignore
|
| 4 |
+
5991dc74fa45e42c24120d3ddf4fd39c92f908f44986c71cf658c5b12deda80b components/qemedia/ADAPTER_NOTICE
|
| 5 |
+
0edae3727291af6b7ed7b3d38bf94d4aaa2c42c01c4d748d676ef9045de1c8df components/qemedia/Dockerfile
|
| 6 |
+
e0a8e97900a1184396b65bca8507d5c7b1a6df58537b61722dfe0f416990f0e2 components/qemedia/LICENSE
|
| 7 |
+
1f6d860d8285f6297e5381c08925a1ece2bf88eb5b0344b10740269e222a060d components/qemedia/README.md
|
| 8 |
+
f97c7ed6f032ebf9e6276f6156c447a2f128739858fc243143d72b86443292f3 components/qemedia/SOURCE_MANIFEST.json
|
| 9 |
+
755b9132babde91fb34bf29a7759c3cead1299484335fcafdb057fd207f210b8 components/qemedia/THIRD_PARTY_NOTICES
|
| 10 |
+
acb6b642cd8d1c4f66e8a82a2cc97c9d4643ca484422e225505c0ea2b739e146 components/qemedia/UPSTREAM_DOCKERFILE
|
| 11 |
+
bd90e5f33d8c325c978e826c5e7a73e4ad73ff535f367ddfed0dec3d52470ade components/qemedia/runtime/qemedia_compat/__init__.py
|
| 12 |
+
0fbea553dc22fa2fd72a4590c2c008eeefaa4af5654a2e9936465c18c79c9149 components/qemedia/runtime/qemedia_compat/environment.py
|
| 13 |
+
1d41688c822b842c70f32502d627c252fcd3526c7be74d6880f2f86d06df981a components/qemedia/runtime/qemedia_compat/server.py
|
| 14 |
+
f1ce27b1c58f9547059e7f820aa65c1a8d8313144855ee8845b2eca91f7e0db3 components/qemedia/upstream/qe_arena/__init__.py
|
| 15 |
+
2925e44219fdef6310ac1e2b60532e3ba1f1e768b33e65f14f1f5e8f86b33510 components/qemedia/upstream/qe_arena/app.py
|
| 16 |
+
978aabadc5044616ff28ab7be69a2e9ff48f1fd82494a6897f4f2b8716283a08 components/qemedia/upstream/qe_arena/corpus/__init__.py
|
| 17 |
+
0485dfbc2676a1f666958935602cc2f347e5fcd95b6bfcd32e8af13cafe07e35 components/qemedia/upstream/qe_arena/corpus/aggregate_risk_factors.py
|
| 18 |
+
f999a088228120810c986f249964ba83d7a54a4853c9bebcbf61313b4362247e components/qemedia/upstream/qe_arena/corpus/alternate_chat_roles.py
|
| 19 |
+
4b4f6e1280956988736c2401747ed0c3d633eedfe38e7d24ec815773f5c21711 components/qemedia/upstream/qe_arena/corpus/amortization_schedule.py
|
| 20 |
+
21517da739674bdc2b22efe9c2a2a7a85d47a7033aae3e24b2c1da8b4ac21684 components/qemedia/upstream/qe_arena/corpus/api_complexity_level.py
|
| 21 |
+
71db4461633e0ad524e11c2384d75675331a515778ce4a8b675c6f738c94a02c components/qemedia/upstream/qe_arena/corpus/artifact_retention_keep.py
|
| 22 |
+
1f1937c25f4717a49a6e809ea81cc20da035f6aa843d4f47ce111b585e3ab4a2 components/qemedia/upstream/qe_arena/corpus/backoff_schedule.py
|
| 23 |
+
2661b8a01fb4d7d1a31169592eaae370b3d4260d6b32187ce4427ffbcfa097ea components/qemedia/upstream/qe_arena/corpus/badge_dimensions.py
|
| 24 |
+
b1d44ea5c1b774f8572374e73468ca34483e3b382c982c28a368549da94656d5 components/qemedia/upstream/qe_arena/corpus/baseline_verdict.py
|
| 25 |
+
01764d4994630e38a91a6599f90142a9b145084dbd5971c564727ac9855f97f8 components/qemedia/upstream/qe_arena/corpus/booking_conflicts.py
|
| 26 |
+
7f70d489eefbdae5794354fa457a39dc50eb0209929cb0f3a9f9493b41adc88a components/qemedia/upstream/qe_arena/corpus/boundary_violations.py
|
| 27 |
+
04d411ac8a666d3916c13090c7658e5cc516028ced9b0db45a334062d96683c5 components/qemedia/upstream/qe_arena/corpus/brace_delta.py
|
| 28 |
+
6f0982869b0ef19ec7b95863008ea45b1a46dbd46108ee24b44338a383a37d23 components/qemedia/upstream/qe_arena/corpus/calibration_fit.py
|
| 29 |
+
42b4727623069a0e774e0d70be6cb9869d871b377ddb6421c60bfa78bd3be126 components/qemedia/upstream/qe_arena/corpus/chat_completion_result.py
|
| 30 |
+
f5c6486256438b89565cc1edcaf016d6e91f3c81067a77a30c9792cac7d0ef39 components/qemedia/upstream/qe_arena/corpus/claim_steal_priority.py
|
| 31 |
+
a77352fd67a18a9c24c3fe697c9310b079c998dc853c2f49eba1a2c877742a62 components/qemedia/upstream/qe_arena/corpus/compare_versions.py
|
| 32 |
+
5e4e65b458e8cd2e9723206e43ea3a85d37df8b82c9f15e19f4da5ce26dd72ff components/qemedia/upstream/qe_arena/corpus/complexity_bucket.py
|
| 33 |
+
3979785d451cc4473ec2b057a404f0a8ea930bd11ce34bedea06f1b953ee9c08 components/qemedia/upstream/qe_arena/corpus/compound_interest.py
|
| 34 |
+
30ff0142461a624790a13766f9463c6fd6f21991442e5e37d46febd51f2ca7ad components/qemedia/upstream/qe_arena/corpus/convert_timecode.py
|
| 35 |
+
af3e694760997b353678c7350b08e43ed26de256792221420006e5d4837712d5 components/qemedia/upstream/qe_arena/corpus/coverage_gap_severity.py
|
| 36 |
+
f85c6167be7fe0094e36b90d19fb4e382a2e804a34dc96fa09f379caf97d5904 components/qemedia/upstream/qe_arena/corpus/crop_to_aspect.py
|
| 37 |
+
61e8975cc643b0bd4d10656d48a77a7314b5e13382794bdcbecf19f2a80b3186 components/qemedia/upstream/qe_arena/corpus/debounce_switch.py
|
| 38 |
+
949197b79f96f244ccba1b44236510ec65d8c9aace59850cde4949697791024f components/qemedia/upstream/qe_arena/corpus/decay_table.py
|
| 39 |
+
c5033c7d0a147c46e9cf1659187879b00e8f253725f1fcc00b6c4e5529c9685b components/qemedia/upstream/qe_arena/corpus/efficiency_reward.py
|
| 40 |
+
11d505901f9d2e00cc5b475d9cca75b4770db77345c1645b10e70620710a70b0 components/qemedia/upstream/qe_arena/corpus/expense_violations.py
|
| 41 |
+
284d4fcd6c5cb23efc4282659991d9a403b46c0d836641071ad7079d8d2c8d0d components/qemedia/upstream/qe_arena/corpus/find_stop.py
|
| 42 |
+
b3b94bcfe78f97b00187e7fe9783a8ae04b9a9b6af6d788f445f64bd52021aa0 components/qemedia/upstream/qe_arena/corpus/flakiness_pattern.py
|
| 43 |
+
11c670fbe537cbeeaa101d9b9db49519f5ebd4cca82b7ccfd66d5d68e352e5ba components/qemedia/upstream/qe_arena/corpus/flaky_hunter_reward.py
|
| 44 |
+
f6ebbaffe1dd8aaccef7ad8ce48d8dfa60bacc8a44051880057c52b163e7748b components/qemedia/upstream/qe_arena/corpus/flaky_run_summary.py
|
| 45 |
+
7e0cf537d1bd38fdbc474bc259a52fbf23f095f35661586d771eca0561481eb0 components/qemedia/upstream/qe_arena/corpus/format_duration.py
|
| 46 |
+
e232fbfe97a36cedf848caa11b9bf51828c5f4c6fe6ad3bf40133c6bc7deabd7 components/qemedia/upstream/qe_arena/corpus/gguf_loader.py
|
| 47 |
+
b5fc54e4b3f6b45af2af289a746fe48d948e806b43910920e6ee31c81bbd805e components/qemedia/upstream/qe_arena/corpus/gguf_special_ids.py
|
| 48 |
+
52d8da6da1348af21303785a5dabfe36a42f7efeaed9b326b21898387a3e6536 components/qemedia/upstream/qe_arena/corpus/glob_match.py
|
| 49 |
+
ce28e349ed362052dd0184dc4f1e215344831edc2f74ebe8438c470964fc70a3 components/qemedia/upstream/qe_arena/corpus/income_tax.py
|
| 50 |
+
edd468fbc9d11830559fbcc2bfb1d7afe35c71980432bb91c87d8c3571a704b7 components/qemedia/upstream/qe_arena/corpus/integer_edge_values.py
|
| 51 |
+
94bc28736f587e3cc350fef83ba95fe70dc44db627bcb037f854332f6b52e7fd components/qemedia/upstream/qe_arena/corpus/ip_allowlist_match.py
|
| 52 |
+
87db0af0b61c0b95b0d8acf9235835db9631f9471d0e7dc29b0296abc76bccde components/qemedia/upstream/qe_arena/corpus/is_collection_endpoint.py
|
| 53 |
+
7d91f4eb06374851748cbd3e33ae5f3d2059a491572449d4fc700ecaaed1431c components/qemedia/upstream/qe_arena/corpus/latency_percentiles.py
|
| 54 |
+
814fc40372c1ece5068b04848f9c8a2a9069d504cf364df62c00a905d0ec777c components/qemedia/upstream/qe_arena/corpus/login_rate_limit.py
|
| 55 |
+
ecc262d19d2b27970901017aa4a006ad2ce97861866ccddae2a9c876c4bbec37 components/qemedia/upstream/qe_arena/corpus/loudness_gain.py
|
| 56 |
+
2c3ec2cb2f5e050ff03d772675c372053fe3eb957f505a33d2d127916ee283bf components/qemedia/upstream/qe_arena/corpus/mail_merge.py
|
| 57 |
+
48972588b8f75f1132aaf0eaa112a35875833b7dc661e3c41ff6972f3ce29dd5 components/qemedia/upstream/qe_arena/corpus/maintainability_index.py
|
| 58 |
+
201bad40ff156e6a0caec2577011286262178000435aacaec83c603ba02aa4f8 components/qemedia/upstream/qe_arena/corpus/maintenance_status.py
|
| 59 |
+
fd5b0f08e59fc763734cdb43d4cd893ce851403281a806902f5945ce71e7e7cd components/qemedia/upstream/qe_arena/corpus/merge_intervals.py
|
| 60 |
+
888558da6833e82d1b2dafadf39aa87609cf5c4bcc96345a4e37ac92cfd1d0de components/qemedia/upstream/qe_arena/corpus/mod_inverse.py
|
| 61 |
+
58cdc61459945cdd9bf20ab09cfa422c85148d76fecfc70567ef81b1240c2f36 components/qemedia/upstream/qe_arena/corpus/mod_pow.py
|
| 62 |
+
1c72218af8a816d24fc7ba7d88901c83db49c056da34efea5f2ba491a77493d2 components/qemedia/upstream/qe_arena/corpus/networkdays.py
|
| 63 |
+
62e849358e01be48618529568005a1b487b411bdc18a01b4c226b824f77320df components/qemedia/upstream/qe_arena/corpus/normalize_rational.py
|
| 64 |
+
6275cc4556df344a4dfccbcdf5930e9561bcb27b93fcb247c9707a84c48f3231 components/qemedia/upstream/qe_arena/corpus/parse_cron_field.py
|
| 65 |
+
52df1c52ecfe9db206a6322350204d2bbbaeb2fe6bd192d8b98d56de8739bf50 components/qemedia/upstream/qe_arena/corpus/parse_max_age.py
|
| 66 |
+
cf81c249d3ff4092557d20bdcf210ce52cbe4c9e2e5e8634d279a46568d2f4df components/qemedia/upstream/qe_arena/corpus/parse_signature_header.py
|
| 67 |
+
5d1a27cea4b7db6b2b2484015dfc73e61ddc04b3d021da8adfb1788ebf0dd54c components/qemedia/upstream/qe_arena/corpus/password_violations.py
|
| 68 |
+
ccf4a9d4183523e3b82f95cf0f5f18efe86881ece0d7274f24f5236233aa4f13 components/qemedia/upstream/qe_arena/corpus/pattern_effectiveness.py
|
| 69 |
+
c7b17812aa575ee19db876d526f0770ad6ee591e6aa2bc624e05527cc1ef7df2 components/qemedia/upstream/qe_arena/corpus/pressure_check.py
|
| 70 |
+
cca54e5fa4dfed47ac23f06111a357fb1a2f9fbd3b29a8d9873d268a91a754ec components/qemedia/upstream/qe_arena/corpus/quality_gain_reward.py
|
| 71 |
+
aafb0bab705f85093cecdfa13bdce9a1f23bbf055b60f50783abc46f020b8fef components/qemedia/upstream/qe_arena/corpus/quality_grade.py
|
| 72 |
+
169e88a7162bc1e2a798b76ee491191ca44fca3051d7eb392b56b7672139142e components/qemedia/upstream/qe_arena/corpus/reconcile_invoices.py
|
| 73 |
+
361cbe3b3c5e2da8317b2cf703dc11405d4c10ad2d62551c65388028238f4fb5 components/qemedia/upstream/qe_arena/corpus/round_sig_figs.py
|
| 74 |
+
368365c0bd5b318b63d1614caba8bd4f752011f6beecf3ede4fbb42f137441d7 components/qemedia/upstream/qe_arena/corpus/safe_join.py
|
| 75 |
+
a26bc6ef76d5dfbc4b0abff3f0189f6bd181f6934bcb6dee3410ab752316223d components/qemedia/upstream/qe_arena/corpus/sample_variance.py
|
| 76 |
+
51ae093e2baeda053434e2e223827384124290ed5317bf160f0b3df366ef02eb components/qemedia/upstream/qe_arena/corpus/select_bitrate_rung.py
|
| 77 |
+
cce40f8f9266e58918b174e82d1b167523a4df1b78a53f07af06fe43d9c9100e components/qemedia/upstream/qe_arena/corpus/shift_cue.py
|
| 78 |
+
540a4e6c04b1e3cc78cf69e42897d6680840c513ffcc86eeba8f2aa735d30cf6 components/qemedia/upstream/qe_arena/corpus/slew_limit.py
|
| 79 |
+
02936fcc7e5931cad5a46b286d098ae2d34698449f2eaa190eaa44f9785543da components/qemedia/upstream/qe_arena/corpus/spec_readiness_score.py
|
| 80 |
+
9188e0c8045fa0d8e1a7a82153f6ccc791e075dd7a6f3b793abd117bb1064275 components/qemedia/upstream/qe_arena/corpus/split_generic_params.py
|
| 81 |
+
d3aac59af147f657bbe61bb45e368d78cee587be7a4fa58208410fd5a9e3d26c components/qemedia/upstream/qe_arena/corpus/streamable_len.py
|
| 82 |
+
62a7ac1680df0375cae8ecb6cf08a3520375cb9c8dea94299a30551d0abe479e components/qemedia/upstream/qe_arena/corpus/string_length_boundaries.py
|
| 83 |
+
13361068ea0f1ebaacadb264bfec120e990341cf66154f77a1a110777be1754e components/qemedia/upstream/qe_arena/corpus/threshold_compliance.py
|
| 84 |
+
081ef70cde049750026cc4f60794f46a74a86424c12d73ea5c278b19563b2e77 components/qemedia/upstream/qe_arena/corpus/token_claims_check.py
|
| 85 |
+
9d10c0da4d0375ea05c99d0e5d2dd57a4bedf1a4fa5a5f48d6cc9344177f19bb components/qemedia/upstream/qe_arena/corpus/token_jaccard.py
|
| 86 |
+
6e20c250fb2d01cf06ed5b099d67089f43f7851e90224399f5865aee539d4f32 components/qemedia/upstream/qe_arena/corpus/trace_sampling_decision.py
|
| 87 |
+
5246d62082d3a37dd57e6d3510ea489a4de4c44a31e5bddb2d4d438817b0c43b components/qemedia/upstream/qe_arena/corpus/truncate_to_token_budget.py
|
| 88 |
+
9feb8f950e2cff5904eddba37a15e16a8888a7cb8f5dc893e74808a36c6f1876 components/qemedia/upstream/qe_arena/corpus/uncovered_line_ranges.py
|
| 89 |
+
bc332a39e0143f24ee326b0f9343150a22f47fa420dc29ecf1cba816385a1d43 components/qemedia/upstream/qe_arena/corpus/validate_csv_row.py
|
| 90 |
+
3132a4152e1baf9061b0e70d3192e0617e8de735195eb560dcfee5011c14f6fc components/qemedia/upstream/qe_arena/corpus/vuln_priority_bucket.py
|
| 91 |
+
28e98e2f9b24bb36171fa2f5c5c9d78be23e193615b265aad092bec771eb8021 components/qemedia/upstream/qe_arena/corpus/wilson_interval.py
|
| 92 |
+
13bb7b068896d5377b8f969c504dde01875df8eef8a0b341348e45bcea5f991b components/qemedia/upstream/qe_arena/domains.py
|
| 93 |
+
4b27436ca7c4eed5e7dda34ccfac6c97eb413cf024274793d4d1cf47b50f9494 components/qemedia/upstream/qe_arena/edit_budget.py
|
| 94 |
+
9675b6598456b5a8dbfe57eb6e6847998d86f2c93722caff3c8a3716d6ecc102 components/qemedia/upstream/qe_arena/environment.py
|
| 95 |
+
0db273642496825ec8f8924a164093df1191b29c92ac83b5497261373c20f768 components/qemedia/upstream/qe_arena/flaky.py
|
| 96 |
+
46e2198bcbe9d415bf775f845a358c2eaa26d390a5aa62d3b806f07b5803fab1 components/qemedia/upstream/qe_arena/flaky_gen.py
|
| 97 |
+
2272e0617a3a079d2e389bf50d62c4cc5da4ec005d2d68239bdfbf7e795fda92 components/qemedia/upstream/qe_arena/flaky_templates.py
|
| 98 |
+
5b389cc8ab64218d3bdcc500f584ef0b78da4b68379bfb014e095d755ccdcdb1 components/qemedia/upstream/qe_arena/guest_harness.py
|
| 99 |
+
ea2b370db92d82e1a0719ecf3416eeafdb7a14a524a94f6d6cd32a5f06b21106 components/qemedia/upstream/qe_arena/keys/manifest_ed25519.pub
|
| 100 |
+
1911ef5d3696695364871da7be9744fd7c81d51fe81ae3c137341dd1b06c8494 components/qemedia/upstream/qe_arena/manifest.py
|
| 101 |
+
28a7abc5213c5a1504151d23148695e7f09e4441b39e941377cb7265ba6ff4de components/qemedia/upstream/qe_arena/mutation.py
|
| 102 |
+
97f080e2505ba4c6034fcc3f0322d9ecd8b9f9852ac19e424cc9273ccd0a9c77 components/qemedia/upstream/qe_arena/runtime_pins.json
|
| 103 |
+
92faaac323c0b524c0181008c305134fc57d2e4c6af1ea6fbf919b48ec9ea03a components/qemedia/upstream/qe_arena/sandbox.py
|
| 104 |
+
4e9aabefa6f23793a05804ec413aaa5d1c5125365156f22cdb50ff600808d34d components/qemedia/upstream/qe_arena/shell.py
|
| 105 |
+
c6b045c7b62b762ae4a56b13fcc61bf997ffd710494f9882e775f533dfe8c522 components/qemedia/upstream/qe_arena/skills/__init__.py
|
| 106 |
+
ec722ad0aa0903fbca443dc8325f2569853b7191edfc525602d3cd0ddaf56037 components/qemedia/upstream/qe_arena/skills/_common.py
|
| 107 |
+
da87595287e1d253512564769274e3063f262fce0d4d4ea0ef5b26d9285a72e0 components/qemedia/upstream/qe_arena/skills/formal.py
|
| 108 |
+
005eabea342ba948e6b68dcc341f3756a8ebdd5fb44830cb13bb482a16ef200c components/qemedia/upstream/qe_arena/skills/media.py
|
| 109 |
+
f198046eb6e9d0610cd966f5e7a99d27e9da2e3f23e3687ecd42f4a5649aab98 components/qemedia/upstream/qe_arena/skills/science.py
|
| 110 |
+
872054f7309500113beab2c853bfeceebd146e60dc36d42f42f9e98e6c4a7b84 components/qemedia/upstream/qe_arena/skills/subtitles.py
|
| 111 |
+
c540dc8eafd3ac648f768b17682ecb1f8f3bd3e14eed9a353c4021c427dc80bd components/qemedia/upstream/qe_arena/tasks.py
|
| 112 |
+
d5a630210e1a8330ec3cc00a5b43d7d92b110a6d0eb8ec5e83d3bba13e85fcc0 components/qemedia/upstream/qe_arena/terminal_app.py
|
| 113 |
+
6ea5cfcffc292e52ead2687728ad6d9c040dfaf32a5610386ac6514d4b1438b3 components/qemedia/upstream/qe_arena/terminal_env.py
|
| 114 |
+
71f35970518b637bfa50fa79897d6f79d065e4531211af402f91a9dba4d31f38 components/qemedia/upstream/qe_arena/wasi_fs.py
|
| 115 |
+
6e81b271a5910977f38deba39ccde6465d70e23e9ed42cbec51f02a6e237c71e components/qemedia/upstream/qe_arena/wasi_worker.py
|
| 116 |
+
c486d87e05b69ab133dd04cba072d5a39de8fda53c9a2f6fd5995570384724b0 schema.json
|
| 117 |
+
7e16aa89ecd785fe76b4c3b1ef887845d33dbf293a849578a02efafb0da92c00 tasks.jsonl
|
| 118 |
+
3ab9912b176d4555f7d38828bd66854b60311dc42c2e25c665cb8296fffaf9db validate_dataset.py
|
SOURCE_LOCK.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"components": {
|
| 3 |
-
"
|
| 4 |
-
"repository": "
|
| 5 |
-
"revision": "
|
| 6 |
-
"license": "
|
| 7 |
"source_file": "SOURCE_MANIFEST.json",
|
| 8 |
-
"record_sha256": "
|
| 9 |
}
|
| 10 |
}
|
| 11 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"components": {
|
| 3 |
+
"qemedia": {
|
| 4 |
+
"repository": "proffesor-for-testing/openenv-qe-arena",
|
| 5 |
+
"revision": "7490e2dc371b5060601ff4399a3d3688bff3ca80",
|
| 6 |
+
"license": "MIT",
|
| 7 |
"source_file": "SOURCE_MANIFEST.json",
|
| 8 |
+
"record_sha256": "f97c7ed6f032ebf9e6276f6156c447a2f128739858fc243143d72b86443292f3"
|
| 9 |
}
|
| 10 |
}
|
| 11 |
}
|
components/{skillsdesk → qemedia}/.dockerignore
RENAMED
|
File without changes
|
components/qemedia/ADAPTER_NOTICE
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This distribution adds a two-task registry, source integrity checks and a single-session OpenEnv transport.
|
| 2 |
+
Original QE generators, graders, task instructions and seed behavior are retained.
|
| 3 |
+
The included qe_arena modules provide the original import dependencies; media tasks are the served selection.
|
components/qemedia/Dockerfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/proffesor-for-testing/openenv-qe-arena-terminal@sha256:57dd0c2bfde0e503f1ff43400530cf99a6e2b8a5d9b1f42e0ae7471501f4b971
|
| 2 |
+
USER root
|
| 3 |
+
COPY upstream/qe_arena /opt/qemedia/qe_arena
|
| 4 |
+
COPY runtime /opt/qemedia
|
| 5 |
+
COPY SOURCE_MANIFEST.json /opt/qemedia/SOURCE_MANIFEST.json
|
| 6 |
+
COPY LICENSE THIRD_PARTY_NOTICES ADAPTER_NOTICE /opt/qemedia/licenses/
|
| 7 |
+
RUN rm -rf /app/qe_arena && chmod -R go-rwx /opt/qemedia /app /opt/qe-arena
|
| 8 |
+
ENV PYTHONPATH=/opt/qemedia PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 OPENENV_MODE=production ENABLE_WEB_INTERFACE=false QE_ARENA_UNSANDBOXED_SHELL=0
|
| 9 |
+
WORKDIR /opt/qemedia
|
| 10 |
+
LABEL org.opencontainers.image.title="Media Workflows v11" \
|
| 11 |
+
org.opencontainers.image.description="Original QE media artifact tasks" \
|
| 12 |
+
org.opencontainers.image.source="https://huggingface.co/datasets/bochencs/openenv-multidomain" \
|
| 13 |
+
org.opencontainers.image.licenses="MIT"
|
| 14 |
+
EXPOSE 8000
|
| 15 |
+
ENTRYPOINT ["/usr/bin/tini", "--"]
|
| 16 |
+
CMD ["python", "-m", "qemedia_compat.server"]
|
components/qemedia/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Dragan Spiridonov
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
components/qemedia/README.md
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Original QE media tasks by Dragan Spiridonov, with a two-task OpenEnv transport.
|
| 2 |
+
|
| 3 |
+
Run `python -m qemedia_compat.server` as root. Commands run through the original isolated shell.
|
| 4 |
+
Use one active session per sandbox. The selected original task IDs and source hashes are in SOURCE_MANIFEST.json.
|
components/qemedia/SOURCE_MANIFEST.json
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"repository": "proffesor-for-testing/openenv-qe-arena",
|
| 3 |
+
"revision": "7490e2dc371b5060601ff4399a3d3688bff3ca80",
|
| 4 |
+
"dataset": "Profa-QE/openenv-qe-arena-tasks",
|
| 5 |
+
"dataset_revision": "f5e0b952cffbb5d82e0c54c131e7b8a68abce69d",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"base_image": "ghcr.io/proffesor-for-testing/openenv-qe-arena-terminal@sha256:57dd0c2bfde0e503f1ff43400530cf99a6e2b8a5d9b1f42e0ae7471501f4b971",
|
| 8 |
+
"sdk_revision": "86a180ede21e044f7929b9a7783ad83aa67d83a3",
|
| 9 |
+
"original_files": {
|
| 10 |
+
"qe_arena/__init__.py": "f1ce27b1c58f9547059e7f820aa65c1a8d8313144855ee8845b2eca91f7e0db3",
|
| 11 |
+
"qe_arena/app.py": "2925e44219fdef6310ac1e2b60532e3ba1f1e768b33e65f14f1f5e8f86b33510",
|
| 12 |
+
"qe_arena/corpus/__init__.py": "978aabadc5044616ff28ab7be69a2e9ff48f1fd82494a6897f4f2b8716283a08",
|
| 13 |
+
"qe_arena/corpus/aggregate_risk_factors.py": "0485dfbc2676a1f666958935602cc2f347e5fcd95b6bfcd32e8af13cafe07e35",
|
| 14 |
+
"qe_arena/corpus/alternate_chat_roles.py": "f999a088228120810c986f249964ba83d7a54a4853c9bebcbf61313b4362247e",
|
| 15 |
+
"qe_arena/corpus/amortization_schedule.py": "4b4f6e1280956988736c2401747ed0c3d633eedfe38e7d24ec815773f5c21711",
|
| 16 |
+
"qe_arena/corpus/api_complexity_level.py": "21517da739674bdc2b22efe9c2a2a7a85d47a7033aae3e24b2c1da8b4ac21684",
|
| 17 |
+
"qe_arena/corpus/artifact_retention_keep.py": "71db4461633e0ad524e11c2384d75675331a515778ce4a8b675c6f738c94a02c",
|
| 18 |
+
"qe_arena/corpus/backoff_schedule.py": "1f1937c25f4717a49a6e809ea81cc20da035f6aa843d4f47ce111b585e3ab4a2",
|
| 19 |
+
"qe_arena/corpus/badge_dimensions.py": "2661b8a01fb4d7d1a31169592eaae370b3d4260d6b32187ce4427ffbcfa097ea",
|
| 20 |
+
"qe_arena/corpus/baseline_verdict.py": "b1d44ea5c1b774f8572374e73468ca34483e3b382c982c28a368549da94656d5",
|
| 21 |
+
"qe_arena/corpus/booking_conflicts.py": "01764d4994630e38a91a6599f90142a9b145084dbd5971c564727ac9855f97f8",
|
| 22 |
+
"qe_arena/corpus/boundary_violations.py": "7f70d489eefbdae5794354fa457a39dc50eb0209929cb0f3a9f9493b41adc88a",
|
| 23 |
+
"qe_arena/corpus/brace_delta.py": "04d411ac8a666d3916c13090c7658e5cc516028ced9b0db45a334062d96683c5",
|
| 24 |
+
"qe_arena/corpus/calibration_fit.py": "6f0982869b0ef19ec7b95863008ea45b1a46dbd46108ee24b44338a383a37d23",
|
| 25 |
+
"qe_arena/corpus/chat_completion_result.py": "42b4727623069a0e774e0d70be6cb9869d871b377ddb6421c60bfa78bd3be126",
|
| 26 |
+
"qe_arena/corpus/claim_steal_priority.py": "f5c6486256438b89565cc1edcaf016d6e91f3c81067a77a30c9792cac7d0ef39",
|
| 27 |
+
"qe_arena/corpus/compare_versions.py": "a77352fd67a18a9c24c3fe697c9310b079c998dc853c2f49eba1a2c877742a62",
|
| 28 |
+
"qe_arena/corpus/complexity_bucket.py": "5e4e65b458e8cd2e9723206e43ea3a85d37df8b82c9f15e19f4da5ce26dd72ff",
|
| 29 |
+
"qe_arena/corpus/compound_interest.py": "3979785d451cc4473ec2b057a404f0a8ea930bd11ce34bedea06f1b953ee9c08",
|
| 30 |
+
"qe_arena/corpus/convert_timecode.py": "30ff0142461a624790a13766f9463c6fd6f21991442e5e37d46febd51f2ca7ad",
|
| 31 |
+
"qe_arena/corpus/coverage_gap_severity.py": "af3e694760997b353678c7350b08e43ed26de256792221420006e5d4837712d5",
|
| 32 |
+
"qe_arena/corpus/crop_to_aspect.py": "f85c6167be7fe0094e36b90d19fb4e382a2e804a34dc96fa09f379caf97d5904",
|
| 33 |
+
"qe_arena/corpus/debounce_switch.py": "61e8975cc643b0bd4d10656d48a77a7314b5e13382794bdcbecf19f2a80b3186",
|
| 34 |
+
"qe_arena/corpus/decay_table.py": "949197b79f96f244ccba1b44236510ec65d8c9aace59850cde4949697791024f",
|
| 35 |
+
"qe_arena/corpus/efficiency_reward.py": "c5033c7d0a147c46e9cf1659187879b00e8f253725f1fcc00b6c4e5529c9685b",
|
| 36 |
+
"qe_arena/corpus/expense_violations.py": "11d505901f9d2e00cc5b475d9cca75b4770db77345c1645b10e70620710a70b0",
|
| 37 |
+
"qe_arena/corpus/find_stop.py": "284d4fcd6c5cb23efc4282659991d9a403b46c0d836641071ad7079d8d2c8d0d",
|
| 38 |
+
"qe_arena/corpus/flakiness_pattern.py": "b3b94bcfe78f97b00187e7fe9783a8ae04b9a9b6af6d788f445f64bd52021aa0",
|
| 39 |
+
"qe_arena/corpus/flaky_hunter_reward.py": "11c670fbe537cbeeaa101d9b9db49519f5ebd4cca82b7ccfd66d5d68e352e5ba",
|
| 40 |
+
"qe_arena/corpus/flaky_run_summary.py": "f6ebbaffe1dd8aaccef7ad8ce48d8dfa60bacc8a44051880057c52b163e7748b",
|
| 41 |
+
"qe_arena/corpus/format_duration.py": "7e0cf537d1bd38fdbc474bc259a52fbf23f095f35661586d771eca0561481eb0",
|
| 42 |
+
"qe_arena/corpus/gguf_loader.py": "e232fbfe97a36cedf848caa11b9bf51828c5f4c6fe6ad3bf40133c6bc7deabd7",
|
| 43 |
+
"qe_arena/corpus/gguf_special_ids.py": "b5fc54e4b3f6b45af2af289a746fe48d948e806b43910920e6ee31c81bbd805e",
|
| 44 |
+
"qe_arena/corpus/glob_match.py": "52d8da6da1348af21303785a5dabfe36a42f7efeaed9b326b21898387a3e6536",
|
| 45 |
+
"qe_arena/corpus/income_tax.py": "ce28e349ed362052dd0184dc4f1e215344831edc2f74ebe8438c470964fc70a3",
|
| 46 |
+
"qe_arena/corpus/integer_edge_values.py": "edd468fbc9d11830559fbcc2bfb1d7afe35c71980432bb91c87d8c3571a704b7",
|
| 47 |
+
"qe_arena/corpus/ip_allowlist_match.py": "94bc28736f587e3cc350fef83ba95fe70dc44db627bcb037f854332f6b52e7fd",
|
| 48 |
+
"qe_arena/corpus/is_collection_endpoint.py": "87db0af0b61c0b95b0d8acf9235835db9631f9471d0e7dc29b0296abc76bccde",
|
| 49 |
+
"qe_arena/corpus/latency_percentiles.py": "7d91f4eb06374851748cbd3e33ae5f3d2059a491572449d4fc700ecaaed1431c",
|
| 50 |
+
"qe_arena/corpus/login_rate_limit.py": "814fc40372c1ece5068b04848f9c8a2a9069d504cf364df62c00a905d0ec777c",
|
| 51 |
+
"qe_arena/corpus/loudness_gain.py": "ecc262d19d2b27970901017aa4a006ad2ce97861866ccddae2a9c876c4bbec37",
|
| 52 |
+
"qe_arena/corpus/mail_merge.py": "2c3ec2cb2f5e050ff03d772675c372053fe3eb957f505a33d2d127916ee283bf",
|
| 53 |
+
"qe_arena/corpus/maintainability_index.py": "48972588b8f75f1132aaf0eaa112a35875833b7dc661e3c41ff6972f3ce29dd5",
|
| 54 |
+
"qe_arena/corpus/maintenance_status.py": "201bad40ff156e6a0caec2577011286262178000435aacaec83c603ba02aa4f8",
|
| 55 |
+
"qe_arena/corpus/merge_intervals.py": "fd5b0f08e59fc763734cdb43d4cd893ce851403281a806902f5945ce71e7e7cd",
|
| 56 |
+
"qe_arena/corpus/mod_inverse.py": "888558da6833e82d1b2dafadf39aa87609cf5c4bcc96345a4e37ac92cfd1d0de",
|
| 57 |
+
"qe_arena/corpus/mod_pow.py": "58cdc61459945cdd9bf20ab09cfa422c85148d76fecfc70567ef81b1240c2f36",
|
| 58 |
+
"qe_arena/corpus/networkdays.py": "1c72218af8a816d24fc7ba7d88901c83db49c056da34efea5f2ba491a77493d2",
|
| 59 |
+
"qe_arena/corpus/normalize_rational.py": "62e849358e01be48618529568005a1b487b411bdc18a01b4c226b824f77320df",
|
| 60 |
+
"qe_arena/corpus/parse_cron_field.py": "6275cc4556df344a4dfccbcdf5930e9561bcb27b93fcb247c9707a84c48f3231",
|
| 61 |
+
"qe_arena/corpus/parse_max_age.py": "52df1c52ecfe9db206a6322350204d2bbbaeb2fe6bd192d8b98d56de8739bf50",
|
| 62 |
+
"qe_arena/corpus/parse_signature_header.py": "cf81c249d3ff4092557d20bdcf210ce52cbe4c9e2e5e8634d279a46568d2f4df",
|
| 63 |
+
"qe_arena/corpus/password_violations.py": "5d1a27cea4b7db6b2b2484015dfc73e61ddc04b3d021da8adfb1788ebf0dd54c",
|
| 64 |
+
"qe_arena/corpus/pattern_effectiveness.py": "ccf4a9d4183523e3b82f95cf0f5f18efe86881ece0d7274f24f5236233aa4f13",
|
| 65 |
+
"qe_arena/corpus/pressure_check.py": "c7b17812aa575ee19db876d526f0770ad6ee591e6aa2bc624e05527cc1ef7df2",
|
| 66 |
+
"qe_arena/corpus/quality_gain_reward.py": "cca54e5fa4dfed47ac23f06111a357fb1a2f9fbd3b29a8d9873d268a91a754ec",
|
| 67 |
+
"qe_arena/corpus/quality_grade.py": "aafb0bab705f85093cecdfa13bdce9a1f23bbf055b60f50783abc46f020b8fef",
|
| 68 |
+
"qe_arena/corpus/reconcile_invoices.py": "169e88a7162bc1e2a798b76ee491191ca44fca3051d7eb392b56b7672139142e",
|
| 69 |
+
"qe_arena/corpus/round_sig_figs.py": "361cbe3b3c5e2da8317b2cf703dc11405d4c10ad2d62551c65388028238f4fb5",
|
| 70 |
+
"qe_arena/corpus/safe_join.py": "368365c0bd5b318b63d1614caba8bd4f752011f6beecf3ede4fbb42f137441d7",
|
| 71 |
+
"qe_arena/corpus/sample_variance.py": "a26bc6ef76d5dfbc4b0abff3f0189f6bd181f6934bcb6dee3410ab752316223d",
|
| 72 |
+
"qe_arena/corpus/select_bitrate_rung.py": "51ae093e2baeda053434e2e223827384124290ed5317bf160f0b3df366ef02eb",
|
| 73 |
+
"qe_arena/corpus/shift_cue.py": "cce40f8f9266e58918b174e82d1b167523a4df1b78a53f07af06fe43d9c9100e",
|
| 74 |
+
"qe_arena/corpus/slew_limit.py": "540a4e6c04b1e3cc78cf69e42897d6680840c513ffcc86eeba8f2aa735d30cf6",
|
| 75 |
+
"qe_arena/corpus/spec_readiness_score.py": "02936fcc7e5931cad5a46b286d098ae2d34698449f2eaa190eaa44f9785543da",
|
| 76 |
+
"qe_arena/corpus/split_generic_params.py": "9188e0c8045fa0d8e1a7a82153f6ccc791e075dd7a6f3b793abd117bb1064275",
|
| 77 |
+
"qe_arena/corpus/streamable_len.py": "d3aac59af147f657bbe61bb45e368d78cee587be7a4fa58208410fd5a9e3d26c",
|
| 78 |
+
"qe_arena/corpus/string_length_boundaries.py": "62a7ac1680df0375cae8ecb6cf08a3520375cb9c8dea94299a30551d0abe479e",
|
| 79 |
+
"qe_arena/corpus/threshold_compliance.py": "13361068ea0f1ebaacadb264bfec120e990341cf66154f77a1a110777be1754e",
|
| 80 |
+
"qe_arena/corpus/token_claims_check.py": "081ef70cde049750026cc4f60794f46a74a86424c12d73ea5c278b19563b2e77",
|
| 81 |
+
"qe_arena/corpus/token_jaccard.py": "9d10c0da4d0375ea05c99d0e5d2dd57a4bedf1a4fa5a5f48d6cc9344177f19bb",
|
| 82 |
+
"qe_arena/corpus/trace_sampling_decision.py": "6e20c250fb2d01cf06ed5b099d67089f43f7851e90224399f5865aee539d4f32",
|
| 83 |
+
"qe_arena/corpus/truncate_to_token_budget.py": "5246d62082d3a37dd57e6d3510ea489a4de4c44a31e5bddb2d4d438817b0c43b",
|
| 84 |
+
"qe_arena/corpus/uncovered_line_ranges.py": "9feb8f950e2cff5904eddba37a15e16a8888a7cb8f5dc893e74808a36c6f1876",
|
| 85 |
+
"qe_arena/corpus/validate_csv_row.py": "bc332a39e0143f24ee326b0f9343150a22f47fa420dc29ecf1cba816385a1d43",
|
| 86 |
+
"qe_arena/corpus/vuln_priority_bucket.py": "3132a4152e1baf9061b0e70d3192e0617e8de735195eb560dcfee5011c14f6fc",
|
| 87 |
+
"qe_arena/corpus/wilson_interval.py": "28e98e2f9b24bb36171fa2f5c5c9d78be23e193615b265aad092bec771eb8021",
|
| 88 |
+
"qe_arena/domains.py": "13bb7b068896d5377b8f969c504dde01875df8eef8a0b341348e45bcea5f991b",
|
| 89 |
+
"qe_arena/edit_budget.py": "4b27436ca7c4eed5e7dda34ccfac6c97eb413cf024274793d4d1cf47b50f9494",
|
| 90 |
+
"qe_arena/environment.py": "9675b6598456b5a8dbfe57eb6e6847998d86f2c93722caff3c8a3716d6ecc102",
|
| 91 |
+
"qe_arena/flaky.py": "0db273642496825ec8f8924a164093df1191b29c92ac83b5497261373c20f768",
|
| 92 |
+
"qe_arena/flaky_gen.py": "46e2198bcbe9d415bf775f845a358c2eaa26d390a5aa62d3b806f07b5803fab1",
|
| 93 |
+
"qe_arena/flaky_templates.py": "2272e0617a3a079d2e389bf50d62c4cc5da4ec005d2d68239bdfbf7e795fda92",
|
| 94 |
+
"qe_arena/guest_harness.py": "5b389cc8ab64218d3bdcc500f584ef0b78da4b68379bfb014e095d755ccdcdb1",
|
| 95 |
+
"qe_arena/keys/manifest_ed25519.pub": "ea2b370db92d82e1a0719ecf3416eeafdb7a14a524a94f6d6cd32a5f06b21106",
|
| 96 |
+
"qe_arena/manifest.py": "1911ef5d3696695364871da7be9744fd7c81d51fe81ae3c137341dd1b06c8494",
|
| 97 |
+
"qe_arena/mutation.py": "28a7abc5213c5a1504151d23148695e7f09e4441b39e941377cb7265ba6ff4de",
|
| 98 |
+
"qe_arena/runtime_pins.json": "97f080e2505ba4c6034fcc3f0322d9ecd8b9f9852ac19e424cc9273ccd0a9c77",
|
| 99 |
+
"qe_arena/sandbox.py": "92faaac323c0b524c0181008c305134fc57d2e4c6af1ea6fbf919b48ec9ea03a",
|
| 100 |
+
"qe_arena/shell.py": "4e9aabefa6f23793a05804ec413aaa5d1c5125365156f22cdb50ff600808d34d",
|
| 101 |
+
"qe_arena/skills/__init__.py": "c6b045c7b62b762ae4a56b13fcc61bf997ffd710494f9882e775f533dfe8c522",
|
| 102 |
+
"qe_arena/skills/_common.py": "ec722ad0aa0903fbca443dc8325f2569853b7191edfc525602d3cd0ddaf56037",
|
| 103 |
+
"qe_arena/skills/formal.py": "da87595287e1d253512564769274e3063f262fce0d4d4ea0ef5b26d9285a72e0",
|
| 104 |
+
"qe_arena/skills/media.py": "005eabea342ba948e6b68dcc341f3756a8ebdd5fb44830cb13bb482a16ef200c",
|
| 105 |
+
"qe_arena/skills/science.py": "f198046eb6e9d0610cd966f5e7a99d27e9da2e3f23e3687ecd42f4a5649aab98",
|
| 106 |
+
"qe_arena/skills/subtitles.py": "872054f7309500113beab2c853bfeceebd146e60dc36d42f42f9e98e6c4a7b84",
|
| 107 |
+
"qe_arena/tasks.py": "c540dc8eafd3ac648f768b17682ecb1f8f3bd3e14eed9a353c4021c427dc80bd",
|
| 108 |
+
"qe_arena/terminal_app.py": "d5a630210e1a8330ec3cc00a5b43d7d92b110a6d0eb8ec5e83d3bba13e85fcc0",
|
| 109 |
+
"qe_arena/terminal_env.py": "6ea5cfcffc292e52ead2687728ad6d9c040dfaf32a5610386ac6514d4b1438b3",
|
| 110 |
+
"qe_arena/wasi_fs.py": "71f35970518b637bfa50fa79897d6f79d065e4531211af402f91a9dba4d31f38",
|
| 111 |
+
"qe_arena/wasi_worker.py": "6e81b271a5910977f38deba39ccde6465d70e23e9ed42cbec51f02a6e237c71e"
|
| 112 |
+
},
|
| 113 |
+
"selected_tasks": [
|
| 114 |
+
"qe_skill-media-d2",
|
| 115 |
+
"qe_skill-media-d1"
|
| 116 |
+
],
|
| 117 |
+
"native_pools": {
|
| 118 |
+
"qe_skill-media-d2": [
|
| 119 |
+
"subtitles",
|
| 120 |
+
"timecode",
|
| 121 |
+
"catalogue",
|
| 122 |
+
"assets"
|
| 123 |
+
],
|
| 124 |
+
"qe_skill-media-d1": [
|
| 125 |
+
"timecode",
|
| 126 |
+
"catalogue",
|
| 127 |
+
"assets"
|
| 128 |
+
]
|
| 129 |
+
},
|
| 130 |
+
"instance_policy": "Native seeded generation; omitted seed draws original randomness."
|
| 131 |
+
}
|
components/qemedia/THIRD_PARTY_NOTICES
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Third-party notices
|
| 2 |
+
===================
|
| 3 |
+
|
| 4 |
+
The real-bug corpus entries listed below are Python ports of code from RuVector,
|
| 5 |
+
https://github.com/ruvnet/RuVector, used under the MIT License. The fixed code comes from
|
| 6 |
+
merged PR #1125 (32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef). Each recorded fault reproduces
|
| 7 |
+
pre-fix behaviour from its parent commit (3e1d1886c50f2db817664648b95fab18e3e4c34b).
|
| 8 |
+
|
| 9 |
+
Entries and origins:
|
| 10 |
+
|
| 11 |
+
- qe_arena/corpus/chat_completion_result.py
|
| 12 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm-cli/src/commands/serve.rs
|
| 13 |
+
fault chat_completion_result/always-stop: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm-cli/src/commands/serve.rs
|
| 14 |
+
fault chat_completion_result/whitespace-token-count: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm-cli/src/commands/serve.rs
|
| 15 |
+
|
| 16 |
+
- qe_arena/corpus/find_stop.py
|
| 17 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs
|
| 18 |
+
fault find_stop/first-listed: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs
|
| 19 |
+
fault find_stop/empty-matches: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs
|
| 20 |
+
|
| 21 |
+
- qe_arena/corpus/gguf_loader.py
|
| 22 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs
|
| 23 |
+
fault gguf_loader/no-split-check: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs
|
| 24 |
+
fault gguf_loader/qwen-rejected: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs
|
| 25 |
+
fault gguf_loader/substring-match: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs
|
| 26 |
+
|
| 27 |
+
- qe_arena/corpus/gguf_special_ids.py
|
| 28 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs
|
| 29 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/candle_backend.rs
|
| 30 |
+
fault gguf_special_ids/eos-from-vocab-guess: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs (pre-fix behaviour (EOS guessed from the vocabulary) expressed through the fixed function's interface)
|
| 31 |
+
fault gguf_special_ids/stop-is-only-eos: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs (pre-fix behaviour (stop on the single EOS id) expressed through the fixed function's interface)
|
| 32 |
+
|
| 33 |
+
- qe_arena/corpus/streamable_len.py
|
| 34 |
+
fixed code: ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs
|
| 35 |
+
fault streamable_len/no-holdback: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs (reconstructed from the pre-fix streaming behaviour; the pre-fix code had no streamable_len)
|
| 36 |
+
fault streamable_len/streams-pending-bytes: ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs (reconstructed from the pre-fix streaming behaviour; the pre-fix code had no streamable_len)
|
| 37 |
+
|
| 38 |
+
Other corpus entries adapt MIT-licensed code by the same authors as this repository; their
|
| 39 |
+
origins are recorded per entry in META["origin"].
|
| 40 |
+
|
| 41 |
+
RuVector licence:
|
| 42 |
+
|
| 43 |
+
MIT License
|
| 44 |
+
|
| 45 |
+
Copyright (c) 2025 rUv
|
| 46 |
+
|
| 47 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 48 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 49 |
+
in the Software without restriction, including without limitation the rights
|
| 50 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 51 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 52 |
+
furnished to do so, subject to the following conditions:
|
| 53 |
+
|
| 54 |
+
The above copyright notice and this permission notice shall be included in all
|
| 55 |
+
copies or substantial portions of the Software.
|
| 56 |
+
|
| 57 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 58 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 59 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 60 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 61 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 62 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 63 |
+
SOFTWARE.
|
components/qemedia/UPSTREAM_DOCKERFILE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The terminal-interface image (qe_arena.terminal_app): the same tasks and WASM graders as Dockerfile, behind
|
| 2 |
+
# tbench2_env-shaped actions (exec / write_file / evaluate) with a real bash per episode.
|
| 3 |
+
#
|
| 4 |
+
# Unlike Dockerfile, the server runs as root: that is what lets qe_arena/shell.py run every episode's commands
|
| 5 |
+
# as its own unprivileged uid (20000-20063). The sources and the WASI runtime are 0700 root, so an episode's
|
| 6 |
+
# shell can read neither the corpus (the reference implementations) nor the graders. On a host that drops
|
| 7 |
+
# CAP_SETUID the shell reports "disabled" at start-up and exec is refused; write_file and evaluate still work.
|
| 8 |
+
FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 AS wasi-runtime
|
| 9 |
+
WORKDIR /build
|
| 10 |
+
COPY requirements-wasmtime.lock /build/requirements-wasmtime.lock
|
| 11 |
+
RUN pip install --no-cache-dir --require-hashes -r /build/requirements-wasmtime.lock
|
| 12 |
+
COPY scripts/build_wasi_runtime.py qe_arena/runtime_pins.json /build/
|
| 13 |
+
RUN python /build/build_wasi_runtime.py --out /opt/qe-arena/wasi --pins /build/runtime_pins.json
|
| 14 |
+
|
| 15 |
+
FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1
|
| 16 |
+
LABEL org.opencontainers.image.source="https://github.com/proffesor-for-testing/openenv-qe-arena"
|
| 17 |
+
LABEL org.opencontainers.image.description="OpenEnv Arena training environment: QE tasks behind a terminal interface"
|
| 18 |
+
LABEL org.opencontainers.image.licenses="MIT"
|
| 19 |
+
WORKDIR /app
|
| 20 |
+
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates tini && rm -rf /var/lib/apt/lists/*
|
| 21 |
+
COPY requirements.lock requirements-wasmtime.lock /app/
|
| 22 |
+
RUN pip install --no-cache-dir --require-hashes -r /app/requirements-wasmtime.lock \
|
| 23 |
+
&& pip install --no-cache-dir -r /app/requirements.lock
|
| 24 |
+
COPY --from=wasi-runtime /opt/qe-arena/wasi /opt/qe-arena/wasi
|
| 25 |
+
COPY qe_arena /app/qe_arena
|
| 26 |
+
COPY openenv.terminal.yaml /app/openenv.yaml
|
| 27 |
+
COPY THIRD_PARTY_NOTICES /app/THIRD_PARTY_NOTICES
|
| 28 |
+
# The sources and runtime are root-only; the image's own world-writable dirs are locked (shell.SHARED_DIRS).
|
| 29 |
+
RUN chmod 0700 /app /opt/qe-arena && chmod 0711 /var/tmp /run/lock
|
| 30 |
+
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false QE_ARENA_WASI_ROOT=/opt/qe-arena/wasi
|
| 31 |
+
EXPOSE 8000
|
| 32 |
+
ENTRYPOINT ["/usr/bin/tini", "--"]
|
| 33 |
+
CMD ["python", "-m", "uvicorn", "qe_arena.terminal_app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|
components/qemedia/runtime/qemedia_compat/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""OpenEnv transport for the selected original QE media tasks."""
|
components/qemedia/runtime/qemedia_compat/environment.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Select original QE media tasks and manage a single active episode."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
import math
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
from threading import RLock
|
| 8 |
+
import weakref
|
| 9 |
+
|
| 10 |
+
from openenv.core.env_server.interfaces import Environment
|
| 11 |
+
from openenv.core.env_server.types import EnvironmentMetadata
|
| 12 |
+
|
| 13 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 14 |
+
SOURCE_REVISION = '7490e2dc371b5060601ff4399a3d3688bff3ca80'
|
| 15 |
+
TASK_IDS = ('qe_skill-media-d2', 'qe_skill-media-d1')
|
| 16 |
+
MANIFEST = json.loads((ROOT / 'SOURCE_MANIFEST.json').read_text())
|
| 17 |
+
if MANIFEST['revision'] != SOURCE_REVISION or tuple(MANIFEST['selected_tasks']) != TASK_IDS:
|
| 18 |
+
raise RuntimeError('Unexpected original source or selected tasks')
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def verify_original_source():
|
| 22 |
+
expected = MANIFEST['original_files']
|
| 23 |
+
if any(p.is_symlink() for p in (ROOT / 'qe_arena').rglob('*')):
|
| 24 |
+
raise RuntimeError('Symlink in original source tree')
|
| 25 |
+
actual = {p.relative_to(ROOT).as_posix() for p in (ROOT / 'qe_arena').rglob('*') if p.is_file()}
|
| 26 |
+
if actual != set(expected):
|
| 27 |
+
raise RuntimeError('Original source inventory mismatch')
|
| 28 |
+
for relative, digest in expected.items():
|
| 29 |
+
path = ROOT / relative
|
| 30 |
+
if (path.is_symlink() or not path.is_file()
|
| 31 |
+
or not path.resolve().is_relative_to(ROOT)
|
| 32 |
+
or hashlib.sha256(path.read_bytes()).hexdigest() != digest):
|
| 33 |
+
raise RuntimeError('Original source hash mismatch: ' + relative)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
verify_original_source()
|
| 37 |
+
from qe_arena import shell, skills # noqa: E402
|
| 38 |
+
from qe_arena.terminal_env import TerminalAction, TerminalEnvironment, TerminalObservation # noqa: E402
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def verify_runtime():
|
| 42 |
+
if os.geteuid() != 0 or os.environ.get('QE_ARENA_UNSANDBOXED_SHELL') == '1':
|
| 43 |
+
raise RuntimeError('The service requires root and the native isolated shell')
|
| 44 |
+
import sys
|
| 45 |
+
for name, module in tuple(sys.modules.items()):
|
| 46 |
+
if name == 'qe_arena' or name.startswith('qe_arena.'):
|
| 47 |
+
filename = getattr(module, '__file__', None)
|
| 48 |
+
if filename is None or not Path(filename).resolve().is_relative_to(ROOT / 'qe_arena'):
|
| 49 |
+
raise RuntimeError('Original module resolved outside the source tree: ' + name)
|
| 50 |
+
if shell.mode() != 'uid':
|
| 51 |
+
raise RuntimeError('Native isolated exec is unavailable')
|
| 52 |
+
if (shell.EXEC_TIMEOUT_S != 30 or shell.MAX_OUTPUT_BYTES != 8192
|
| 53 |
+
or shell.MAX_WRITE_BYTES != 65536 or shell.MAX_READ_BYTES != 65536):
|
| 54 |
+
raise RuntimeError('Native shell limits changed')
|
| 55 |
+
if skills.SERVED['qe_skill-media-d2'] != ('subtitles', 'timecode', 'catalogue', 'assets'):
|
| 56 |
+
raise RuntimeError('Native media d2 pool changed')
|
| 57 |
+
if skills.SERVED['qe_skill-media-d1'] != ('timecode', 'catalogue', 'assets'):
|
| 58 |
+
raise RuntimeError('Native media d1 pool changed')
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
_SESSION_LOCK = RLock()
|
| 62 |
+
_OWNER = None
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
class CompatEnvironment(Environment):
|
| 66 |
+
SUPPORTS_CONCURRENT_SESSIONS = False
|
| 67 |
+
|
| 68 |
+
def __init__(self):
|
| 69 |
+
super().__init__()
|
| 70 |
+
self._original = TerminalEnvironment()
|
| 71 |
+
self._task_id = None
|
| 72 |
+
self._terminal = None
|
| 73 |
+
|
| 74 |
+
def reset(self, seed=None, episode_id=None, *, task_id=None, index=None, split='train', **kwargs):
|
| 75 |
+
global _OWNER
|
| 76 |
+
# Validate before touching an existing episode, including the seed-zero case.
|
| 77 |
+
if kwargs:
|
| 78 |
+
raise ValueError('Unsupported reset arguments: ' + ', '.join(sorted(kwargs)))
|
| 79 |
+
if split != 'train':
|
| 80 |
+
raise ValueError('Unknown split')
|
| 81 |
+
if index is not None:
|
| 82 |
+
if type(index) is not int or not 0 <= index < len(TASK_IDS):
|
| 83 |
+
raise ValueError('Invalid task index')
|
| 84 |
+
if task_id is not None and task_id != TASK_IDS[index]:
|
| 85 |
+
raise ValueError('Task selection mismatch')
|
| 86 |
+
task_id = TASK_IDS[index]
|
| 87 |
+
if type(task_id) is not str or task_id not in TASK_IDS:
|
| 88 |
+
raise ValueError('Reset requires a selected task_id or index')
|
| 89 |
+
if seed is not None and (type(seed) is not int or not 0 <= seed < 2**64):
|
| 90 |
+
raise ValueError('Seed must be an unsigned 64-bit integer')
|
| 91 |
+
with _SESSION_LOCK:
|
| 92 |
+
verify_runtime()
|
| 93 |
+
owner = _OWNER() if _OWNER is not None else None
|
| 94 |
+
if owner is not None and owner is not self:
|
| 95 |
+
raise RuntimeError('Another episode is active in this sandbox')
|
| 96 |
+
was_active = owner is self
|
| 97 |
+
_OWNER = weakref.ref(self)
|
| 98 |
+
try:
|
| 99 |
+
opening = self._original.reset(task_id=task_id, seed=seed, episode_id=episode_id)
|
| 100 |
+
except BaseException:
|
| 101 |
+
if not was_active:
|
| 102 |
+
self._original.close()
|
| 103 |
+
_OWNER = None
|
| 104 |
+
self._task_id = None
|
| 105 |
+
raise
|
| 106 |
+
self._task_id = task_id
|
| 107 |
+
self._terminal = None
|
| 108 |
+
return opening
|
| 109 |
+
|
| 110 |
+
def step(self, action, timeout_s=None, **kwargs):
|
| 111 |
+
global _OWNER
|
| 112 |
+
with _SESSION_LOCK:
|
| 113 |
+
if self._task_id is None:
|
| 114 |
+
raise RuntimeError('Reset before stepping')
|
| 115 |
+
if self._terminal is not None:
|
| 116 |
+
return self._terminal.model_copy(deep=True)
|
| 117 |
+
native = action if isinstance(action, TerminalAction) else TerminalAction.model_validate(action)
|
| 118 |
+
observed = self._original.step(native, timeout_s=timeout_s, **kwargs)
|
| 119 |
+
if observed.done:
|
| 120 |
+
reward = observed.reward
|
| 121 |
+
if (isinstance(reward, bool) or not isinstance(reward, (int, float))
|
| 122 |
+
or not math.isfinite(reward) or reward not in (0, 1)):
|
| 123 |
+
raise RuntimeError('Original terminal reward is not binary')
|
| 124 |
+
self._terminal = observed.model_copy(deep=True)
|
| 125 |
+
if _OWNER is not None and _OWNER() is self:
|
| 126 |
+
_OWNER = None
|
| 127 |
+
return observed
|
| 128 |
+
|
| 129 |
+
@property
|
| 130 |
+
def state(self):
|
| 131 |
+
return self._original.state
|
| 132 |
+
|
| 133 |
+
def close(self):
|
| 134 |
+
global _OWNER
|
| 135 |
+
with _SESSION_LOCK:
|
| 136 |
+
# This closes only this instance's workspace, including metadata-only instances.
|
| 137 |
+
self._original.close()
|
| 138 |
+
if _OWNER is not None and _OWNER() is self:
|
| 139 |
+
_OWNER = None
|
| 140 |
+
self._task_id = None
|
| 141 |
+
self._terminal = None
|
| 142 |
+
|
| 143 |
+
def get_metadata(self):
|
| 144 |
+
return EnvironmentMetadata(name='qemedia', version='1.0.0',
|
| 145 |
+
description='Original QE media artifact tasks')
|
| 146 |
+
|
| 147 |
+
def list_splits(self):
|
| 148 |
+
return ['train']
|
| 149 |
+
|
| 150 |
+
def list_tasks(self, split):
|
| 151 |
+
if split != 'train':
|
| 152 |
+
raise ValueError('Unknown split')
|
| 153 |
+
return [{'id': task_id, 'index': i} for i, task_id in enumerate(TASK_IDS)]
|
| 154 |
+
|
| 155 |
+
def num_tasks(self, split):
|
| 156 |
+
return len(self.list_tasks(split))
|
| 157 |
+
|
| 158 |
+
def get_task(self, split, index):
|
| 159 |
+
if type(index) is not int or not 0 <= index < len(TASK_IDS):
|
| 160 |
+
raise ValueError('Invalid task index')
|
| 161 |
+
return self.list_tasks(split)[index]
|
| 162 |
+
|
| 163 |
+
def get_task_range(self, split, start=None, stop=None):
|
| 164 |
+
tasks = self.list_tasks(split)
|
| 165 |
+
for bound in (start, stop):
|
| 166 |
+
if bound is not None and (type(bound) is not int or not 0 <= bound <= len(tasks)):
|
| 167 |
+
raise ValueError('Invalid task range')
|
| 168 |
+
if start is not None and stop is not None and start > stop:
|
| 169 |
+
raise ValueError('Invalid task range')
|
| 170 |
+
return tasks[start:stop]
|
components/qemedia/runtime/qemedia_compat/server.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Serve the original terminal action and observation models."""
|
| 2 |
+
from openenv.core.env_server.http_server import create_app
|
| 3 |
+
from .environment import CompatEnvironment, TerminalAction, TerminalObservation, verify_runtime
|
| 4 |
+
|
| 5 |
+
verify_runtime()
|
| 6 |
+
app = create_app(CompatEnvironment, TerminalAction, TerminalObservation,
|
| 7 |
+
env_name='qemedia', max_concurrent_envs=1, mode='production')
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def main():
|
| 11 |
+
import uvicorn
|
| 12 |
+
uvicorn.run(app, host='0.0.0.0', port=8000, workers=1, log_level='warning')
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
if __name__ == '__main__':
|
| 16 |
+
main()
|
components/qemedia/upstream/qe_arena/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""OpenEnv Arena training environment for quality-engineering tasks."""
|
components/qemedia/upstream/qe_arena/app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import logging
|
| 2 |
+
import threading
|
| 3 |
+
|
| 4 |
+
from openenv.core.env_server.http_server import create_app
|
| 5 |
+
|
| 6 |
+
from . import sandbox
|
| 7 |
+
from .environment import QEAction, QEEnvironment, QEObservation
|
| 8 |
+
|
| 9 |
+
app = create_app(QEEnvironment, QEAction, QEObservation, env_name="qe_arena", max_concurrent_envs=8)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def _warm_sandbox() -> None:
|
| 13 |
+
# Each sandbox worker compiles python.wasm (~5 s each at --cpus=2, measured in the image). Do it
|
| 14 |
+
# now, off the request path, so /health answers at once and the first episode does not wait.
|
| 15 |
+
try:
|
| 16 |
+
sandbox.warm()
|
| 17 |
+
except Exception: # noqa: BLE001 - logged here; the next run_calls raises the same error
|
| 18 |
+
logging.getLogger(__name__).exception("sandbox warm-up failed")
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
threading.Thread(target=_warm_sandbox, name="sandbox-warm", daemon=True).start()
|
components/qemedia/upstream/qe_arena/corpus/__init__.py
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Corpus of small, pure QE functions used by the bug-fix and mutant-kill task families.
|
| 2 |
+
|
| 3 |
+
Each module in this package follows the corpus contract in docs/DESIGN.md: a one-line module
|
| 4 |
+
docstring, a ``META`` dict, the entry function plus any helpers, and ``gen_inputs(rng, n)``.
|
| 5 |
+
|
| 6 |
+
An entry whose META has ``real_faults`` is a real-bug entry: the function is the fixed upstream code
|
| 7 |
+
and each real fault records the pre-fix logic as an exact text replacement in ``function_source``.
|
| 8 |
+
Real-bug entries are served only by the qe_bugfix real tier (``REAL_NAMES``); the injected tiers and
|
| 9 |
+
qe_mutant_kill draw from ``INJECTED_NAMES``.
|
| 10 |
+
|
| 11 |
+
``META["domain"]`` names the arena domain the code belongs to (``qe_arena.domains.DOMAINS``). A task
|
| 12 |
+
cell draws only entries of its own domain (``domain_names``).
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import ast
|
| 17 |
+
import importlib
|
| 18 |
+
import pkgutil
|
| 19 |
+
import random
|
| 20 |
+
from dataclasses import dataclass
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
|
| 23 |
+
from ..domains import DOMAINS, SOFTWARE
|
| 24 |
+
|
| 25 |
+
_PACKAGE_DIR = Path(__file__).resolve().parent
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
@dataclass(frozen=True)
|
| 29 |
+
class RealFault:
|
| 30 |
+
"""A defect that existed upstream before a fix, as an exact replacement in ``function_source``."""
|
| 31 |
+
|
| 32 |
+
id: str
|
| 33 |
+
kind: str
|
| 34 |
+
summary: str
|
| 35 |
+
origin: str
|
| 36 |
+
find: str
|
| 37 |
+
replace: str
|
| 38 |
+
note: str = "" # how the fault relates to the pre-fix code when it is not a literal copy of it
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
@dataclass(frozen=True)
|
| 42 |
+
class CorpusEntry:
|
| 43 |
+
name: str
|
| 44 |
+
entry: str
|
| 45 |
+
origin: str
|
| 46 |
+
tags: tuple[str, ...]
|
| 47 |
+
source: str
|
| 48 |
+
function_source: str
|
| 49 |
+
summary: str
|
| 50 |
+
domain: str = SOFTWARE
|
| 51 |
+
real_faults: tuple[RealFault, ...] = ()
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def _is_kept(node: ast.stmt) -> bool:
|
| 55 |
+
if isinstance(node, (ast.Import, ast.ImportFrom)):
|
| 56 |
+
return True
|
| 57 |
+
return isinstance(node, ast.FunctionDef) and node.name != "gen_inputs"
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def _start_line(node: ast.stmt) -> int:
|
| 61 |
+
decorators = getattr(node, "decorator_list", [])
|
| 62 |
+
return min([node.lineno] + [d.lineno for d in decorators])
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def extract_function_source(text: str) -> str:
|
| 66 |
+
"""Return the imports plus every function except ``gen_inputs``, verbatim from ``text``.
|
| 67 |
+
|
| 68 |
+
Consecutive kept top-level statements form one run, copied with their original
|
| 69 |
+
formatting and comments. Runs are joined with two blank lines.
|
| 70 |
+
"""
|
| 71 |
+
lines = text.splitlines()
|
| 72 |
+
runs: list[list[ast.stmt]] = []
|
| 73 |
+
previous_kept = False
|
| 74 |
+
for node in ast.parse(text).body:
|
| 75 |
+
kept = _is_kept(node)
|
| 76 |
+
if kept and previous_kept:
|
| 77 |
+
runs[-1].append(node)
|
| 78 |
+
elif kept:
|
| 79 |
+
runs.append([node])
|
| 80 |
+
previous_kept = kept
|
| 81 |
+
chunks = [
|
| 82 |
+
"\n".join(lines[_start_line(run[0]) - 1 : run[-1].end_lineno])
|
| 83 |
+
for run in runs
|
| 84 |
+
]
|
| 85 |
+
return "\n\n\n".join(chunks) + "\n"
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def _summary(text: str) -> str:
|
| 89 |
+
docstring = ast.get_docstring(ast.parse(text)) or ""
|
| 90 |
+
first_line = docstring.strip().splitlines()[0] if docstring.strip() else ""
|
| 91 |
+
for marker in (" Adapted from ", " Ported from ", " Original."):
|
| 92 |
+
if marker in first_line:
|
| 93 |
+
first_line = first_line.split(marker, 1)[0]
|
| 94 |
+
return first_line.strip()
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def _load_entries() -> dict[str, CorpusEntry]:
|
| 98 |
+
entries: dict[str, CorpusEntry] = {}
|
| 99 |
+
names = sorted(
|
| 100 |
+
info.name
|
| 101 |
+
for info in pkgutil.iter_modules([str(_PACKAGE_DIR)])
|
| 102 |
+
if not info.name.startswith("_")
|
| 103 |
+
)
|
| 104 |
+
for name in names:
|
| 105 |
+
module = importlib.import_module(f"{__name__}.{name}")
|
| 106 |
+
text = (_PACKAGE_DIR / f"{name}.py").read_text(encoding="utf-8")
|
| 107 |
+
meta = module.META
|
| 108 |
+
if meta.get("domain") not in DOMAINS:
|
| 109 |
+
raise ValueError(f"corpus entry {name}: META domain must be one of {DOMAINS}, got {meta.get('domain')!r}")
|
| 110 |
+
entries[name] = CorpusEntry(
|
| 111 |
+
name=name,
|
| 112 |
+
entry=meta["entry"],
|
| 113 |
+
origin=meta["origin"],
|
| 114 |
+
tags=tuple(meta["tags"]),
|
| 115 |
+
source=text,
|
| 116 |
+
function_source=extract_function_source(text),
|
| 117 |
+
summary=_summary(text),
|
| 118 |
+
domain=meta["domain"],
|
| 119 |
+
real_faults=tuple(RealFault(**fault) for fault in meta.get("real_faults", ())),
|
| 120 |
+
)
|
| 121 |
+
return entries
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
ENTRIES: dict[str, CorpusEntry] = _load_entries()
|
| 125 |
+
REAL_NAMES: tuple[str, ...] = tuple(name for name, e in ENTRIES.items() if e.real_faults)
|
| 126 |
+
INJECTED_NAMES: tuple[str, ...] = tuple(name for name, e in ENTRIES.items() if not e.real_faults)
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
def domain_names(domain: str, names: tuple[str, ...] = INJECTED_NAMES) -> tuple[str, ...]:
|
| 130 |
+
"""The entries of ``names`` that belong to ``domain``, in their original (sorted) order."""
|
| 131 |
+
if domain not in DOMAINS:
|
| 132 |
+
raise ValueError(f"unknown domain: {domain!r}")
|
| 133 |
+
return tuple(name for name in names if ENTRIES[name].domain == domain)
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def _module(name: str):
|
| 137 |
+
if name not in ENTRIES:
|
| 138 |
+
raise KeyError(f"unknown corpus entry: {name}")
|
| 139 |
+
return importlib.import_module(f"{__name__}.{name}")
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
def call_reference(name: str, args: list):
|
| 143 |
+
"""Call the original entry function directly. For tests only; the verifier runs it in a sandbox."""
|
| 144 |
+
module = _module(name)
|
| 145 |
+
return getattr(module, ENTRIES[name].entry)(*args)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def gen_inputs(name: str, seed: int, n: int) -> list[list]:
|
| 149 |
+
"""Deterministic argument lists for ``name``: boundary cases first, then seeded random ones."""
|
| 150 |
+
return _module(name).gen_inputs(random.Random(seed), n)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
__all__ = ["CorpusEntry", "ENTRIES", "INJECTED_NAMES", "REAL_NAMES", "RealFault", "call_reference",
|
| 154 |
+
"domain_names", "extract_function_source", "gen_inputs"]
|
components/qemedia/upstream/qe_arena/corpus/aggregate_risk_factors.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Rank defect-risk factors by their average contribution across files. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/mcp/tools/defect-intelligence/predict.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "aggregate_risk_factors",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/mcp/tools/defect-intelligence/predict.ts",
|
| 6 |
+
"tags": ["defect-prediction", "grouping", "sorting"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def aggregate_risk_factors(predictions):
|
| 12 |
+
"""Aggregate per-file risk factors into the top five factors overall.
|
| 13 |
+
|
| 14 |
+
predictions is a list (one item per file) of lists of [factor_name, contribution]
|
| 15 |
+
pairs, where contribution is an int. Every occurrence counts, even if a factor
|
| 16 |
+
repeats within one file. For each factor name: count = number of occurrences and
|
| 17 |
+
impact = round(sum of contributions / count, 2). Returns [name, impact, count]
|
| 18 |
+
rows sorted by impact descending; ties keep the order in which the factor names
|
| 19 |
+
first appeared. At most the first 5 rows are returned.
|
| 20 |
+
"""
|
| 21 |
+
totals = {}
|
| 22 |
+
for factors in predictions:
|
| 23 |
+
for name, contribution in factors:
|
| 24 |
+
impact, count = totals.get(name, [0, 0])
|
| 25 |
+
totals[name] = [impact + contribution, count + 1]
|
| 26 |
+
ranked = []
|
| 27 |
+
for name, (impact, count) in totals.items():
|
| 28 |
+
ranked.append([name, round(impact / count, 2), count])
|
| 29 |
+
ranked.sort(key=lambda row: row[1], reverse=True)
|
| 30 |
+
return ranked[:5]
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def gen_inputs(rng, n):
|
| 34 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 35 |
+
cases = [
|
| 36 |
+
[[]],
|
| 37 |
+
[[[]]],
|
| 38 |
+
[[[["churn", 30]]]],
|
| 39 |
+
[[[["churn", 30]], [["churn", 10]]]],
|
| 40 |
+
[[[["churn", 30], ["churn", 0]]]],
|
| 41 |
+
[[[["a", 10], ["b", 20]], [["b", 0], ["c", 5]]]],
|
| 42 |
+
[[[["a", 7], ["b", 7], ["c", 7]]]],
|
| 43 |
+
[[[["a", 1], ["b", 2], ["c", 3], ["d", 4], ["e", 5], ["f", 6]]]],
|
| 44 |
+
[[[["a", 6], ["b", 5], ["c", 4], ["d", 3], ["e", 2], ["f", 1]]]],
|
| 45 |
+
[[[["a", 1], ["b", 1], ["c", 1], ["d", 1], ["e", 1], ["f", 1]]]],
|
| 46 |
+
[[[["x", 10]], [["x", 11]], [["x", 11]]]],
|
| 47 |
+
[[[["size", -5], ["age", 3]]]],
|
| 48 |
+
]
|
| 49 |
+
names = ["churn", "size", "age", "authors", "bugs", "deps", "lint"]
|
| 50 |
+
while len(cases) < n:
|
| 51 |
+
cases.append([[[[rng.choice(names), rng.randint(0, 50)] for _ in range(rng.randint(0, 3))]
|
| 52 |
+
for _ in range(rng.randint(1, 4))]])
|
| 53 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/alternate_chat_roles.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Normalize a chat transcript into strict user/assistant alternation. Adapted from proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/llm_providers/providers/anthropic_provider.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "alternate_chat_roles",
|
| 5 |
+
"origin": "proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/llm_providers/providers/anthropic_provider.py",
|
| 6 |
+
"tags": ["llm", "normalization", "lists"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def alternate_chat_roles(messages):
|
| 12 |
+
"""Return a new transcript whose roles strictly alternate and start and end with "user".
|
| 13 |
+
|
| 14 |
+
messages is a list of {"role": "user" or "assistant", "content": str}; the input is
|
| 15 |
+
not modified. Consecutive messages with the same role are merged into one message,
|
| 16 |
+
joining the contents with "\n\n". After merging: if the first message is not from
|
| 17 |
+
"user", {"role": "user", "content": "Continue."} is inserted at the front; then if
|
| 18 |
+
the last message is not from "user", {"role": "user", "content": "Please respond."}
|
| 19 |
+
is appended. An empty list returns [].
|
| 20 |
+
"""
|
| 21 |
+
result = []
|
| 22 |
+
for msg in messages:
|
| 23 |
+
if result and result[-1]["role"] == msg["role"]:
|
| 24 |
+
result[-1]["content"] += "\n\n" + msg["content"]
|
| 25 |
+
else:
|
| 26 |
+
result.append({"role": msg["role"], "content": msg["content"]})
|
| 27 |
+
if result and result[0]["role"] != "user":
|
| 28 |
+
result.insert(0, {"role": "user", "content": "Continue."})
|
| 29 |
+
if result and result[-1]["role"] != "user":
|
| 30 |
+
result.append({"role": "user", "content": "Please respond."})
|
| 31 |
+
return result
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def gen_inputs(rng, n):
|
| 35 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 36 |
+
def _m(role, content):
|
| 37 |
+
return {"role": role, "content": content}
|
| 38 |
+
|
| 39 |
+
u, a = "user", "assistant"
|
| 40 |
+
cases = [
|
| 41 |
+
[[]],
|
| 42 |
+
[[_m(u, "hi")]],
|
| 43 |
+
[[_m(a, "hi")]],
|
| 44 |
+
[[_m(u, "q"), _m(a, "r")]],
|
| 45 |
+
[[_m(u, "a"), _m(u, "b")]],
|
| 46 |
+
[[_m(a, "a"), _m(a, "b"), _m(u, "c")]],
|
| 47 |
+
[[_m(u, "a"), _m(a, "b"), _m(a, "c"), _m(u, "d")]],
|
| 48 |
+
[[_m(a, "x"), _m(u, "y"), _m(u, "z"), _m(a, "w")]],
|
| 49 |
+
[[_m(u, ""), _m(u, ""), _m(u, "")]],
|
| 50 |
+
]
|
| 51 |
+
while len(cases) < n:
|
| 52 |
+
cases.append([[_m(rng.choice([u, a]), rng.choice("abcdefg")) for _ in range(rng.randint(1, 6))]])
|
| 53 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/amortization_schedule.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Summarise a level-payment loan in integer cents. Original."""
|
| 2 |
+
|
| 3 |
+
import math
|
| 4 |
+
from fractions import Fraction
|
| 5 |
+
|
| 6 |
+
META = {
|
| 7 |
+
"entry": "amortization_schedule",
|
| 8 |
+
"origin": "Original.",
|
| 9 |
+
"tags": ["loan", "amortization", "money"],
|
| 10 |
+
"domain": "finance-economics",
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def amortization_schedule(principal_cents, annual_rate_bp, months):
|
| 15 |
+
"""Summarise a fixed-rate level-payment loan in integer cents.
|
| 16 |
+
|
| 17 |
+
r = annual_rate_bp / 120000 per month, exact. payment = ceil(principal_cents / months) if the
|
| 18 |
+
rate is 0, else ceil(principal_cents * r / (1 - (1 + r) ** -months)). From balance =
|
| 19 |
+
principal_cents, each month's interest is balance * r rounded half up to a cent. The loan closes
|
| 20 |
+
in the first month where balance + interest <= payment, or in month `months`, by paying
|
| 21 |
+
balance + interest; otherwise balance becomes balance + interest - payment.
|
| 22 |
+
Returns [payment, final_payment, total_interest, months_paid].
|
| 23 |
+
Raises ValueError if principal_cents < 1, months < 1 or annual_rate_bp is outside 0..5000.
|
| 24 |
+
"""
|
| 25 |
+
if principal_cents < 1 or months < 1 or not 0 <= annual_rate_bp <= 5000:
|
| 26 |
+
raise ValueError
|
| 27 |
+
if annual_rate_bp == 0:
|
| 28 |
+
payment = math.ceil(Fraction(principal_cents, months))
|
| 29 |
+
else:
|
| 30 |
+
rate = Fraction(annual_rate_bp, 120000)
|
| 31 |
+
payment = math.ceil(principal_cents * rate / (1 - (1 + rate) ** -months))
|
| 32 |
+
balance, total_interest = principal_cents, 0
|
| 33 |
+
for month in range(1, months + 1):
|
| 34 |
+
interest = (balance * annual_rate_bp + 60000) // 120000
|
| 35 |
+
total_interest += interest
|
| 36 |
+
if balance + interest <= payment or month == months:
|
| 37 |
+
return [payment, balance + interest, total_interest, month]
|
| 38 |
+
balance += interest - payment
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def gen_inputs(rng, n):
|
| 42 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 43 |
+
cases = [
|
| 44 |
+
[100, 0, 3],
|
| 45 |
+
[10, 0, 7],
|
| 46 |
+
[9, 0, 7],
|
| 47 |
+
[7, 1200, 2],
|
| 48 |
+
[1000, 3000, 3],
|
| 49 |
+
[705, 2132, 7],
|
| 50 |
+
[1229, 2598, 5],
|
| 51 |
+
[1774, 608, 6],
|
| 52 |
+
[59999, 1, 1],
|
| 53 |
+
[100000, 0, 12],
|
| 54 |
+
[100000, 600, 12],
|
| 55 |
+
[100000, 600, 1],
|
| 56 |
+
[1, 600, 1],
|
| 57 |
+
[1, 1, 1],
|
| 58 |
+
[25000000, 450, 360],
|
| 59 |
+
[2000000, 5000, 24],
|
| 60 |
+
[2000000, 4999, 24],
|
| 61 |
+
[500000, 1200, 6],
|
| 62 |
+
[0, 600, 12],
|
| 63 |
+
[100000, 600, 0],
|
| 64 |
+
[100000, -1, 12],
|
| 65 |
+
[100000, 5001, 12],
|
| 66 |
+
]
|
| 67 |
+
while len(cases) < n:
|
| 68 |
+
months = rng.choice([1, 2, 3, 6, 12, 24, 36, 48, 60, rng.randint(1, 120), rng.choice([180, 240, 360])])
|
| 69 |
+
rate = rng.choice([0, rng.randint(1, 3000), rng.randint(1, 3000), rng.randint(1, 5000)])
|
| 70 |
+
cases.append([rng.randint(1, 50) * rng.choice([1, 100, 1000, 10000]) + rng.randint(0, 99), rate, months])
|
| 71 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/api_complexity_level.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Bucket an API's performance-test planning complexity. Adapted from proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/agents/performance_planner_agent.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "api_complexity_level",
|
| 5 |
+
"origin": "proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/agents/performance_planner_agent.py",
|
| 6 |
+
"tags": ["performance", "planning", "thresholds"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def api_complexity_level(total_endpoints, critical_paths, data_intensive_ops):
|
| 12 |
+
"""Return "low", "medium" or "high" for the planning complexity of an API.
|
| 13 |
+
|
| 14 |
+
score = total_endpoints + 2 * critical_paths + 3 * data_intensive_ops.
|
| 15 |
+
score < 10 is "low", 10 <= score < 25 is "medium", score >= 25 is "high".
|
| 16 |
+
Raises ValueError if any count is negative, or if critical_paths or
|
| 17 |
+
data_intensive_ops is greater than total_endpoints.
|
| 18 |
+
"""
|
| 19 |
+
if min(total_endpoints, critical_paths, data_intensive_ops) < 0:
|
| 20 |
+
raise ValueError("counts must be non-negative")
|
| 21 |
+
if critical_paths > total_endpoints or data_intensive_ops > total_endpoints:
|
| 22 |
+
raise ValueError("subset counts cannot exceed total_endpoints")
|
| 23 |
+
score = total_endpoints + critical_paths * 2 + data_intensive_ops * 3
|
| 24 |
+
if score < 10:
|
| 25 |
+
return "low"
|
| 26 |
+
if score < 25:
|
| 27 |
+
return "medium"
|
| 28 |
+
return "high"
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def gen_inputs(rng, n):
|
| 32 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 33 |
+
cases = [
|
| 34 |
+
[0, 0, 0],
|
| 35 |
+
[9, 0, 0],
|
| 36 |
+
[10, 0, 0],
|
| 37 |
+
[7, 1, 0],
|
| 38 |
+
[6, 0, 1],
|
| 39 |
+
[8, 1, 0],
|
| 40 |
+
[24, 0, 0],
|
| 41 |
+
[25, 0, 0],
|
| 42 |
+
[18, 2, 1],
|
| 43 |
+
[17, 2, 1],
|
| 44 |
+
[12, 3, 2],
|
| 45 |
+
[3, 3, 3],
|
| 46 |
+
[4, 3, 3],
|
| 47 |
+
[-1, 0, 0],
|
| 48 |
+
[5, -1, 0],
|
| 49 |
+
[5, 0, -2],
|
| 50 |
+
[2, 3, 0],
|
| 51 |
+
[2, 0, 3],
|
| 52 |
+
[3, 3, 0],
|
| 53 |
+
]
|
| 54 |
+
while len(cases) < n:
|
| 55 |
+
total = rng.randint(0, 20)
|
| 56 |
+
cases.append([total, rng.randint(0, total), rng.randint(0, total)])
|
| 57 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/artifact_retention_keep.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Decide whether a stored test artifact survives the retention policy. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/storage/utils/retention.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "artifact_retention_keep",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/storage/utils/retention.py",
|
| 6 |
+
"tags": ["storage", "time-window", "policy"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def artifact_retention_keep(rank, keep_latest_n, created_day, retention_days, expires_day,
|
| 12 |
+
default_ttl_days, today):
|
| 13 |
+
"""Return True if an artifact should be kept. Days are integer day numbers.
|
| 14 |
+
|
| 15 |
+
rank is the artifact's 0-based position among the newest artifacts (0 = newest),
|
| 16 |
+
or None if unranked. Rules in order:
|
| 17 |
+
1. rank is not None and rank < keep_latest_n -> True (always kept).
|
| 18 |
+
2. retention_days is not None and today > created_day + retention_days -> False.
|
| 19 |
+
3. expires_day is not None and today > expires_day -> False.
|
| 20 |
+
4. retention_days and expires_day are both None and
|
| 21 |
+
today > created_day + default_ttl_days -> False.
|
| 22 |
+
5. Otherwise True. An artifact is still kept on its last day (today equal to the limit).
|
| 23 |
+
"""
|
| 24 |
+
if rank is not None and rank < keep_latest_n:
|
| 25 |
+
return True
|
| 26 |
+
if retention_days is not None and today > created_day + retention_days:
|
| 27 |
+
return False
|
| 28 |
+
if expires_day is not None and today > expires_day:
|
| 29 |
+
return False
|
| 30 |
+
if retention_days is None and expires_day is None:
|
| 31 |
+
if today > created_day + default_ttl_days:
|
| 32 |
+
return False
|
| 33 |
+
return True
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def gen_inputs(rng, n):
|
| 37 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 38 |
+
cases = [
|
| 39 |
+
[0, 1, 0, None, None, 30, 100],
|
| 40 |
+
[1, 1, 0, None, None, 30, 100],
|
| 41 |
+
[None, 5, 0, None, None, 30, 100],
|
| 42 |
+
[None, 5, 0, None, None, 30, 30],
|
| 43 |
+
[None, 5, 0, None, None, 30, 31],
|
| 44 |
+
[None, 0, 10, 7, None, 30, 17],
|
| 45 |
+
[None, 0, 10, 7, None, 30, 18],
|
| 46 |
+
[None, 0, 10, 7, None, 3, 16],
|
| 47 |
+
[None, 0, 10, None, 20, 3, 20],
|
| 48 |
+
[None, 0, 10, None, 20, 3, 21],
|
| 49 |
+
[None, 0, 10, None, 20, 300, 21],
|
| 50 |
+
[None, 0, 10, 30, 20, 300, 21],
|
| 51 |
+
[None, 0, 10, 5, 40, 30, 16],
|
| 52 |
+
[2, 3, 0, 1, 1, 1, 50],
|
| 53 |
+
[3, 3, 0, 1, 1, 1, 50],
|
| 54 |
+
[0, 0, 0, None, None, 0, 1],
|
| 55 |
+
]
|
| 56 |
+
while len(cases) < n:
|
| 57 |
+
created = rng.randint(0, 50)
|
| 58 |
+
cases.append([rng.choice([None, rng.randint(0, 5)]), rng.randint(0, 4), created,
|
| 59 |
+
rng.choice([None, rng.randint(0, 30)]),
|
| 60 |
+
rng.choice([None, created + rng.randint(0, 40)]),
|
| 61 |
+
rng.randint(1, 40), created + rng.randint(0, 60)])
|
| 62 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/backoff_schedule.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""List capped exponential retry delays with their jitter allowance. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/retry-engine.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "backoff_schedule",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/retry-engine.ts",
|
| 6 |
+
"tags": ["retry", "backoff", "arithmetic"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def backoff_schedule(attempts, base_ms, max_ms, jitter_pct):
|
| 12 |
+
"""Return the maximum delay (ms) before each retry attempt 0..attempts-1.
|
| 13 |
+
|
| 14 |
+
For attempt k: exponential = min(base_ms * 2**k, max_ms) and the delay is
|
| 15 |
+
exponential + exponential * jitter_pct // 100 (the largest value the random jitter
|
| 16 |
+
can add, using integer division). Returns a list of `attempts` ints ([] for 0).
|
| 17 |
+
Raises ValueError if attempts < 0, base_ms < 1, max_ms < base_ms, or jitter_pct
|
| 18 |
+
is outside 0..100.
|
| 19 |
+
"""
|
| 20 |
+
if attempts < 0 or base_ms < 1 or max_ms < base_ms:
|
| 21 |
+
raise ValueError("invalid backoff parameters")
|
| 22 |
+
if jitter_pct < 0 or jitter_pct > 100:
|
| 23 |
+
raise ValueError("jitter_pct must be within 0..100")
|
| 24 |
+
delays = []
|
| 25 |
+
for attempt in range(attempts):
|
| 26 |
+
exponential = min(base_ms * 2 ** attempt, max_ms)
|
| 27 |
+
delays.append(exponential + exponential * jitter_pct // 100)
|
| 28 |
+
return delays
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def gen_inputs(rng, n):
|
| 32 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 33 |
+
cases = [
|
| 34 |
+
[0, 100, 1000, 0],
|
| 35 |
+
[1, 100, 1000, 0],
|
| 36 |
+
[4, 100, 1000, 0],
|
| 37 |
+
[5, 100, 1000, 0],
|
| 38 |
+
[6, 100, 1600, 25],
|
| 39 |
+
[5, 1000, 32000, 25],
|
| 40 |
+
[3, 7, 7, 50],
|
| 41 |
+
[4, 3, 20, 33],
|
| 42 |
+
[3, 10, 100, 100],
|
| 43 |
+
[2, 10, 100, 101],
|
| 44 |
+
[2, 10, 100, -1],
|
| 45 |
+
[-1, 10, 100, 0],
|
| 46 |
+
[2, 0, 100, 0],
|
| 47 |
+
[2, 50, 49, 0],
|
| 48 |
+
[10, 1, 1000, 10],
|
| 49 |
+
]
|
| 50 |
+
while len(cases) < n:
|
| 51 |
+
base = rng.randint(1, 500)
|
| 52 |
+
cases.append([rng.randint(0, 10), base, base * rng.randint(1, 40), rng.randint(0, 100)])
|
| 53 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/badge_dimensions.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compute SVG badge geometry from label and message lengths. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/badges/generator.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "badge_dimensions",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/badges/generator.py",
|
| 6 |
+
"tags": ["reporting", "arithmetic"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def badge_dimensions(label, message):
|
| 12 |
+
"""Return the integer layout of a two-part status badge (shields.io style).
|
| 13 |
+
|
| 14 |
+
With char_width = 6 pixels:
|
| 15 |
+
label_width = len(label) * 6 + 10
|
| 16 |
+
message_width = len(message) * 6 + 10
|
| 17 |
+
width = label_width + message_width
|
| 18 |
+
label_x = label_width * 10 // 2
|
| 19 |
+
message_x = label_width * 10 + message_width * 10 // 2
|
| 20 |
+
label_text_length = len(label) * 6 * 10
|
| 21 |
+
message_text_length = len(message) * 6 * 10
|
| 22 |
+
Returns a dict with exactly those seven keys.
|
| 23 |
+
"""
|
| 24 |
+
char_width = 6
|
| 25 |
+
label_width = len(label) * char_width + 10
|
| 26 |
+
message_width = len(message) * char_width + 10
|
| 27 |
+
return {
|
| 28 |
+
"width": label_width + message_width,
|
| 29 |
+
"label_width": label_width,
|
| 30 |
+
"message_width": message_width,
|
| 31 |
+
"label_x": (label_width * 10) // 2,
|
| 32 |
+
"message_x": (label_width * 10) + (message_width * 10) // 2,
|
| 33 |
+
"label_text_length": len(label) * char_width * 10,
|
| 34 |
+
"message_text_length": len(message) * char_width * 10,
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def gen_inputs(rng, n):
|
| 39 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 40 |
+
cases = [
|
| 41 |
+
["", ""],
|
| 42 |
+
["a", ""],
|
| 43 |
+
["", "a"],
|
| 44 |
+
["coverage", "87%"],
|
| 45 |
+
["build", "passing"],
|
| 46 |
+
["tests", "1203 passed"],
|
| 47 |
+
["quality gate", "failed"],
|
| 48 |
+
]
|
| 49 |
+
words = ["coverage", "tests", "build", "flaky", "mutation", "92%", "ok", "failed", "A+", "v3.1.0"]
|
| 50 |
+
while len(cases) < n:
|
| 51 |
+
cases.append([rng.choice(words)[: rng.randint(0, 8)], rng.choice(words)])
|
| 52 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/baseline_verdict.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compare a test success rate against its baseline. Adapted from proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/services/pattern_analytics.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "baseline_verdict",
|
| 5 |
+
"origin": "proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/services/pattern_analytics.py",
|
| 6 |
+
"tags": ["analytics", "thresholds", "regression"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def baseline_verdict(current_success, baseline_success):
|
| 12 |
+
"""Classify the change of a test success rate (integer percent) versus a baseline.
|
| 13 |
+
|
| 14 |
+
baseline_success None -> "no baseline", without checking current_success at all.
|
| 15 |
+
Otherwise with d = current - baseline:
|
| 16 |
+
d > 10 -> "significantly improved"
|
| 17 |
+
0 < d <= 10 -> "improved"
|
| 18 |
+
-5 <= d <= 0 -> "maintained"
|
| 19 |
+
d < -5 -> "degraded"
|
| 20 |
+
When baseline_success is not None, raises ValueError if either rate is outside 0..100.
|
| 21 |
+
"""
|
| 22 |
+
if baseline_success is None:
|
| 23 |
+
return "no baseline"
|
| 24 |
+
for rate in (current_success, baseline_success):
|
| 25 |
+
if rate < 0 or rate > 100:
|
| 26 |
+
raise ValueError("rates are percentages")
|
| 27 |
+
if current_success > baseline_success + 10:
|
| 28 |
+
return "significantly improved"
|
| 29 |
+
if current_success > baseline_success:
|
| 30 |
+
return "improved"
|
| 31 |
+
if current_success >= baseline_success - 5:
|
| 32 |
+
return "maintained"
|
| 33 |
+
return "degraded"
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def gen_inputs(rng, n):
|
| 37 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 38 |
+
cases = [
|
| 39 |
+
[50, None],
|
| 40 |
+
[0, 0],
|
| 41 |
+
[61, 50],
|
| 42 |
+
[60, 50],
|
| 43 |
+
[59, 50],
|
| 44 |
+
[51, 50],
|
| 45 |
+
[50, 50],
|
| 46 |
+
[46, 50],
|
| 47 |
+
[45, 50],
|
| 48 |
+
[44, 50],
|
| 49 |
+
[100, 89],
|
| 50 |
+
[100, 90],
|
| 51 |
+
[0, 6],
|
| 52 |
+
[0, 5],
|
| 53 |
+
[101, 50],
|
| 54 |
+
[50, -1],
|
| 55 |
+
[-1, None],
|
| 56 |
+
]
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
base = rng.randint(0, 100)
|
| 59 |
+
cases.append([max(0, min(100, base + rng.randint(-15, 15))), base])
|
| 60 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/booking_conflicts.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Find meeting-room bookings that clash once a cleaning turnover gap is required. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "booking_conflicts",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["scheduling", "intervals", "calendar"],
|
| 7 |
+
"domain": "office-white-collar",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def booking_conflicts(bookings, turnover):
|
| 12 |
+
"""Return clashing meeting-room bookings as a list of [i, j, shortfall], i < j, sorted.
|
| 13 |
+
|
| 14 |
+
bookings are [room, start, end] with integer minutes 0 <= start < end <= 1440; a room
|
| 15 |
+
needs turnover (int >= 0) free minutes between meetings. i and j clash when the room is
|
| 16 |
+
the same and start_i < end_j + turnover and start_j < end_i + turnover; shortfall is
|
| 17 |
+
min(end_i, end_j) + turnover - max(start_i, start_j). Raises ValueError for a negative
|
| 18 |
+
turnover or a booking time outside 0 <= start < end <= 1440.
|
| 19 |
+
"""
|
| 20 |
+
if turnover < 0:
|
| 21 |
+
raise ValueError("turnover must be >= 0")
|
| 22 |
+
for room, start, end in bookings:
|
| 23 |
+
if not 0 <= start < end <= 1440:
|
| 24 |
+
raise ValueError("bad booking time")
|
| 25 |
+
clashes = []
|
| 26 |
+
for i in range(len(bookings)):
|
| 27 |
+
room_i, start_i, end_i = bookings[i]
|
| 28 |
+
for j in range(i + 1, len(bookings)):
|
| 29 |
+
room_j, start_j, end_j = bookings[j]
|
| 30 |
+
if room_i == room_j and start_i < end_j + turnover and start_j < end_i + turnover:
|
| 31 |
+
clashes.append([i, j, min(end_i, end_j) + turnover - max(start_i, start_j)])
|
| 32 |
+
return clashes
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def gen_inputs(rng, n):
|
| 36 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 37 |
+
cases = [
|
| 38 |
+
[[], 0],
|
| 39 |
+
[[["Oak", 540, 600], ["Oak", 600, 660]], 0],
|
| 40 |
+
[[["Oak", 540, 600], ["Oak", 600, 660]], 10],
|
| 41 |
+
[[["Oak", 540, 600], ["Oak", 610, 660]], 10],
|
| 42 |
+
[[["Oak", 540, 600], ["Oak", 609, 660]], 10],
|
| 43 |
+
[[["Oak", 540, 600], ["Elm", 570, 630]], 0],
|
| 44 |
+
[[["Oak", 0, 30], ["Oak", 1380, 1440], ["Oak", 20, 40]], 0],
|
| 45 |
+
[[["Oak", 600, 660], ["Oak", 540, 600], ["Oak", 630, 700]], 5],
|
| 46 |
+
[[["Oak", 600, 660], ["Oak", 540, 600]], 0],
|
| 47 |
+
[[["Oak", 540, 600]], -1],
|
| 48 |
+
[[["Oak", 600, 600]], 0],
|
| 49 |
+
[[["Oak", -1, 30]], 0],
|
| 50 |
+
[[["Oak", 1400, 1441]], 0],
|
| 51 |
+
[[["Elm", 480, 540], ["Oak", 700, 650]], 0],
|
| 52 |
+
]
|
| 53 |
+
rooms = ["A", "B", "C"]
|
| 54 |
+
while len(cases) < n:
|
| 55 |
+
bookings = []
|
| 56 |
+
for _ in range(rng.choice([2, 2, 3, 4])):
|
| 57 |
+
start = 5 * rng.randint(96, 216)
|
| 58 |
+
bookings.append([rng.choice(rooms), start, start + 5 * rng.randint(3, 24)])
|
| 59 |
+
cases.append([bookings, rng.choice([0, 0, 5, 10, 15])])
|
| 60 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/boundary_violations.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Build request values that each violate one schema boundary. Adapted from proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/agents/functional_negative_agent.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "boundary_violations",
|
| 5 |
+
"origin": "proffesor-for-testing/sentinel-api-testing@704f47fbc4d2d75ed9261f9a602d76aea930d01b:sentinel_backend/orchestration_service/agents/functional_negative_agent.py",
|
| 6 |
+
"tags": ["api", "negative-testing", "boundary-values"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def boundary_violations(properties):
|
| 12 |
+
"""Return up to three property values that each break one JSON-schema boundary.
|
| 13 |
+
|
| 14 |
+
properties maps a name to a schema dict and is visited in insertion order.
|
| 15 |
+
- "integer" or "number": maximum + 1 if "maximum" is set, else minimum - 1 if
|
| 16 |
+
"minimum" is set.
|
| 17 |
+
- "string" (also the default when "type" is missing): "x" * (maxLength + 1) if
|
| 18 |
+
"maxLength" is set, else "x" * (minLength - 1) if minLength is set and > 0.
|
| 19 |
+
- "array": ["item"] * (maxItems + 1) if "maxItems" is set, else
|
| 20 |
+
["item"] * (minItems - 1) if minItems is set and > 0.
|
| 21 |
+
Other types, and properties with no usable boundary, are skipped. Stops as soon
|
| 22 |
+
as three modifications exist. Returns a dict of property name -> violating value.
|
| 23 |
+
"""
|
| 24 |
+
modifications = {}
|
| 25 |
+
for name, schema in properties.items():
|
| 26 |
+
kind = schema.get("type", "string")
|
| 27 |
+
if kind in ("integer", "number"):
|
| 28 |
+
if "maximum" in schema:
|
| 29 |
+
modifications[name] = schema["maximum"] + 1
|
| 30 |
+
elif "minimum" in schema:
|
| 31 |
+
modifications[name] = schema["minimum"] - 1
|
| 32 |
+
elif kind == "string":
|
| 33 |
+
if "maxLength" in schema:
|
| 34 |
+
modifications[name] = "x" * (schema["maxLength"] + 1)
|
| 35 |
+
elif "minLength" in schema and schema["minLength"] > 0:
|
| 36 |
+
modifications[name] = "x" * (schema["minLength"] - 1)
|
| 37 |
+
elif kind == "array":
|
| 38 |
+
if "maxItems" in schema:
|
| 39 |
+
modifications[name] = ["item"] * (schema["maxItems"] + 1)
|
| 40 |
+
elif "minItems" in schema and schema["minItems"] > 0:
|
| 41 |
+
modifications[name] = ["item"] * (schema["minItems"] - 1)
|
| 42 |
+
if len(modifications) >= 3:
|
| 43 |
+
break
|
| 44 |
+
return modifications
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def gen_inputs(rng, n):
|
| 48 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 49 |
+
def _schema(rng):
|
| 50 |
+
kind = rng.choice(["integer", "number", "string", "array", "boolean", None])
|
| 51 |
+
schema = {} if kind is None else {"type": kind}
|
| 52 |
+
names = {"integer": ("minimum", "maximum"), "number": ("minimum", "maximum"),
|
| 53 |
+
"string": ("minLength", "maxLength"), "array": ("minItems", "maxItems")}
|
| 54 |
+
low_key, high_key = names.get(kind or "string", ("minLength", "maxLength"))
|
| 55 |
+
if rng.random() < 0.6:
|
| 56 |
+
schema[low_key] = rng.randint(0, 4)
|
| 57 |
+
if rng.random() < 0.5:
|
| 58 |
+
schema[high_key] = rng.randint(1, 6)
|
| 59 |
+
return schema
|
| 60 |
+
|
| 61 |
+
cases = [
|
| 62 |
+
[{}],
|
| 63 |
+
[{"a": {"type": "integer", "maximum": 10}}],
|
| 64 |
+
[{"a": {"type": "number", "minimum": 0}}],
|
| 65 |
+
[{"a": {"type": "integer", "minimum": 2, "maximum": 5}}],
|
| 66 |
+
[{"a": {"type": "integer"}}],
|
| 67 |
+
[{"s": {"maxLength": 3}}],
|
| 68 |
+
[{"s": {"type": "string", "minLength": 0}}],
|
| 69 |
+
[{"s": {"type": "string", "minLength": 1}}],
|
| 70 |
+
[{"s": {"type": "string", "minLength": 3, "maxLength": 4}}],
|
| 71 |
+
[{"s": {"type": "string", "minLength": 4}}],
|
| 72 |
+
[{"l": {"type": "array", "maxItems": 1}}],
|
| 73 |
+
[{"l": {"type": "array", "minItems": 1}}],
|
| 74 |
+
[{"l": {"type": "array", "minItems": 3}}],
|
| 75 |
+
[{"l": {"type": "array", "minItems": 0}}],
|
| 76 |
+
[{"b": {"type": "boolean", "maximum": 1}}],
|
| 77 |
+
[{"a": {"type": "integer", "maximum": 1}, "b": {"maxLength": 0}, "c": {"type": "array", "maxItems": 0}}],
|
| 78 |
+
[{"a": {"type": "integer", "maximum": 1}, "b": {"maxLength": 0}, "c": {"type": "array", "maxItems": 0}, "d": {"type": "number", "minimum": 1}}],
|
| 79 |
+
[{"a": {"type": "integer"}, "b": {"maxLength": 1}, "c": {"type": "boolean"}, "d": {"type": "number", "minimum": -3}, "e": {"type": "array", "minItems": 2}}],
|
| 80 |
+
]
|
| 81 |
+
while len(cases) < n:
|
| 82 |
+
cases.append([{f"p{i}": _schema(rng) for i in range(rng.randint(1, 5))}])
|
| 83 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/brace_delta.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Count the net curly-brace depth change of a source line, ignoring strings. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/parsers/multi-language-parser.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "brace_delta",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/parsers/multi-language-parser.ts",
|
| 6 |
+
"tags": ["parsing", "strings"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def brace_delta(line):
|
| 12 |
+
"""Return (number of "{") - (number of "}") in line, ignoring braces inside strings.
|
| 13 |
+
|
| 14 |
+
A string starts at ", ' or ` and ends at the next occurrence of the same quote
|
| 15 |
+
character that is not immediately preceded by a backslash. Braces inside a string
|
| 16 |
+
are not counted. An unterminated string runs to the end of the line.
|
| 17 |
+
"""
|
| 18 |
+
delta = 0
|
| 19 |
+
in_string = False
|
| 20 |
+
quote = ""
|
| 21 |
+
for i in range(len(line)):
|
| 22 |
+
ch = line[i]
|
| 23 |
+
if in_string:
|
| 24 |
+
if ch == quote and line[i - 1] != "\\":
|
| 25 |
+
in_string = False
|
| 26 |
+
continue
|
| 27 |
+
if ch == '"' or ch == "'" or ch == "`":
|
| 28 |
+
in_string = True
|
| 29 |
+
quote = ch
|
| 30 |
+
elif ch == "{":
|
| 31 |
+
delta += 1
|
| 32 |
+
elif ch == "}":
|
| 33 |
+
delta -= 1
|
| 34 |
+
return delta
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def gen_inputs(rng, n):
|
| 38 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 39 |
+
cases = [
|
| 40 |
+
[""],
|
| 41 |
+
["{"],
|
| 42 |
+
["}"],
|
| 43 |
+
["{}"],
|
| 44 |
+
["if (x) {"],
|
| 45 |
+
["} else {"],
|
| 46 |
+
["'{'"],
|
| 47 |
+
['"}" + {'],
|
| 48 |
+
["`${a}` {"],
|
| 49 |
+
['"a\\"{" }'],
|
| 50 |
+
["'it\\'s {' {"],
|
| 51 |
+
['"{" \'}\' {'],
|
| 52 |
+
["'{"],
|
| 53 |
+
['"x" {{ "y" }'],
|
| 54 |
+
["{'\"'}"],
|
| 55 |
+
]
|
| 56 |
+
alphabet = ['{', '}', '{', '}', '"', "'", '`', '\\', 'a', ' ']
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
cases.append(["".join(rng.choice(alphabet) for _ in range(rng.randint(1, 16)))])
|
| 59 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/calibration_fit.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Least-squares gain and offset calibration in exact arithmetic. Original."""
|
| 2 |
+
|
| 3 |
+
from fractions import Fraction
|
| 4 |
+
|
| 5 |
+
META = {
|
| 6 |
+
"entry": "calibration_fit",
|
| 7 |
+
"origin": "Original.",
|
| 8 |
+
"tags": ["calibration", "regression", "exact-arithmetic"],
|
| 9 |
+
"domain": "natural-science",
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def calibration_fit(pairs, tolerance):
|
| 14 |
+
"""Fit reference = gain * raw + offset to [raw, reference] integer pairs by ordinary least squares.
|
| 15 |
+
|
| 16 |
+
With n pairs and sums Sx = sum(raw), Sy = sum(reference), Sxx = sum(raw * raw) and
|
| 17 |
+
Sxy = sum(raw * reference): gain = (n * Sxy - Sx * Sy) / (n * Sxx - Sx * Sx) and
|
| 18 |
+
offset = (Sy - gain * Sx) / n, both exact. A pair's residual is
|
| 19 |
+
gain * raw + offset - reference; the fit is accepted when every residual's absolute value is
|
| 20 |
+
<= tolerance. Returns [[gain_num, gain_den], [offset_num, offset_den], accepted], the
|
| 21 |
+
fractions in lowest terms with a positive denominator and accepted a bool.
|
| 22 |
+
Raises ValueError if fewer than two distinct raw readings are given (including no pairs).
|
| 23 |
+
"""
|
| 24 |
+
n = len(pairs)
|
| 25 |
+
sx = sum(raw for raw, _ in pairs)
|
| 26 |
+
sy = sum(ref for _, ref in pairs)
|
| 27 |
+
sxx = sum(raw * raw for raw, _ in pairs)
|
| 28 |
+
sxy = sum(raw * ref for raw, ref in pairs)
|
| 29 |
+
denominator = n * sxx - sx * sx
|
| 30 |
+
if denominator == 0:
|
| 31 |
+
raise ValueError("need at least two distinct raw readings")
|
| 32 |
+
gain = Fraction(n * sxy - sx * sy, denominator)
|
| 33 |
+
offset = (sy - gain * sx) / n
|
| 34 |
+
worst = max(abs(gain * raw + offset - ref) for raw, ref in pairs)
|
| 35 |
+
return [[gain.numerator, gain.denominator], [offset.numerator, offset.denominator], worst <= tolerance]
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def gen_inputs(rng, n):
|
| 39 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 40 |
+
cases = [
|
| 41 |
+
[[], 0], [[[5, 10]], 0], [[[5, 10], [5, 12]], 1], [[[0, 1], [10, 21]], 0],
|
| 42 |
+
[[[0, 3], [1, 5], [2, 7]], 0], [[[0, 0], [1, 1], [2, 3]], 0], [[[0, 0], [1, 1], [2, 3]], 1],
|
| 43 |
+
[[[1, 2], [2, 3], [3, 5], [4, 4]], 1], [[[-2, 7], [2, -1]], 0], [[[3, 4], [7, 4]], 0],
|
| 44 |
+
[[[100, 251], [200, 498], [300, 752]], 2], [[[100, 251], [200, 498], [300, 752]], 1],
|
| 45 |
+
[[[1, 10], [3, 2]], 5], [[[0, 5], [4, 9], [8, 11], [12, 18]], 1],
|
| 46 |
+
]
|
| 47 |
+
while len(cases) < n:
|
| 48 |
+
gain, offset = rng.randint(-3, 5), rng.randint(-20, 20)
|
| 49 |
+
raws = [rng.randint(-10, 40) for _ in range(rng.randint(2, 4 if rng.random() < 0.6 else 7))]
|
| 50 |
+
pairs = [[x, gain * x + offset + rng.randint(-2, 2)] for x in raws]
|
| 51 |
+
cases.append([pairs, rng.randint(0, 3)])
|
| 52 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/chat_completion_result.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Build the finish_reason and token usage of an OpenAI-style chat completion. Ported from Rust; adapted from ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm-cli/src/commands/serve.rs (MIT)."""
|
| 2 |
+
|
| 3 |
+
PRE_FIX = "ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm-cli/src/commands/serve.rs"
|
| 4 |
+
META = {
|
| 5 |
+
"entry": "chat_completion_result",
|
| 6 |
+
"origin": "ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm-cli/src/commands/serve.rs",
|
| 7 |
+
"tags": ["llm", "api", "accounting"],
|
| 8 |
+
"domain": "software-engineering",
|
| 9 |
+
"real_faults": [
|
| 10 |
+
{"id": "chat_completion_result/always-stop", "kind": "constant-field", "origin": PRE_FIX,
|
| 11 |
+
"summary": "finish_reason is always stop, even when max_tokens cut the reply or generation failed",
|
| 12 |
+
"find": " if cause == \"length\":\n finish_reason = \"length\"\n"
|
| 13 |
+
" elif cause in (\"stop\", \"end_of_sequence\", \"cancelled\"):\n finish_reason = \"stop\"\n"
|
| 14 |
+
" else:\n raise ValueError(\"generation ended with an error\")\n",
|
| 15 |
+
"replace": " finish_reason = \"stop\"\n"},
|
| 16 |
+
{"id": "chat_completion_result/whitespace-token-count", "kind": "placeholder-approximation",
|
| 17 |
+
"origin": PRE_FIX, "summary": "usage counts whitespace-separated words, not tokens",
|
| 18 |
+
"find": " used = [prompt_tokens, completion_tokens]\n",
|
| 19 |
+
"replace": " used = [len(prompt.split()), len(completion.split())]\n"},
|
| 20 |
+
],
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def chat_completion_result(cause, prompt, completion, prompt_tokens, completion_tokens):
|
| 25 |
+
"""Return {"finish_reason": ..., "usage": {...}} for a finished chat completion.
|
| 26 |
+
|
| 27 |
+
cause says how generation ended. "length" (max_tokens reached) gives finish_reason
|
| 28 |
+
"length"; "stop" (a stop sequence), "end_of_sequence" (an end-of-turn token) and
|
| 29 |
+
"cancelled" give "stop"; "error" or any other cause raises ValueError. usage is
|
| 30 |
+
{"prompt_tokens": p, "completion_tokens": c, "total_tokens": p + c} where p and c
|
| 31 |
+
are the tokenizer's counts prompt_tokens and completion_tokens; the prompt and
|
| 32 |
+
completion texts do not affect usage. Raises ValueError if a count is negative.
|
| 33 |
+
"""
|
| 34 |
+
if prompt_tokens < 0 or completion_tokens < 0:
|
| 35 |
+
raise ValueError("token counts must be non-negative")
|
| 36 |
+
if cause == "length":
|
| 37 |
+
finish_reason = "length"
|
| 38 |
+
elif cause in ("stop", "end_of_sequence", "cancelled"):
|
| 39 |
+
finish_reason = "stop"
|
| 40 |
+
else:
|
| 41 |
+
raise ValueError("generation ended with an error")
|
| 42 |
+
used = [prompt_tokens, completion_tokens]
|
| 43 |
+
usage = {"prompt_tokens": used[0], "completion_tokens": used[1], "total_tokens": used[0] + used[1]}
|
| 44 |
+
return {"finish_reason": finish_reason, "usage": usage}
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def gen_inputs(rng, n):
|
| 48 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 49 |
+
cases = [
|
| 50 |
+
["stop", "", "", 0, 0],
|
| 51 |
+
["length", "Hi", "Hello there", 1, 2],
|
| 52 |
+
["end_of_sequence", "Capital of France?", "Paris", 5, 1],
|
| 53 |
+
["cancelled", "a b", "c", 2, 1],
|
| 54 |
+
["error", "a", "b", 1, 1],
|
| 55 |
+
["timeout", "a", "b", 1, 1],
|
| 56 |
+
["stop", "one two three", "four five", 3, 2],
|
| 57 |
+
["length", "x", "y", -1, 0],
|
| 58 |
+
["stop", "x", "y", 0, -1],
|
| 59 |
+
["STOP", "x", "y", 1, 1],
|
| 60 |
+
["stop", "Hello, world!", "Bonjour", 4, 3],
|
| 61 |
+
["end_of_sequence", "a b c d", "", 9, 0],
|
| 62 |
+
]
|
| 63 |
+
words = ["the", "cat", "sat", "Paris", "is", "x=1;", "ok", "no"]
|
| 64 |
+
causes = ["stop", "stop", "end_of_sequence", "end_of_sequence", "length", "cancelled", "error"]
|
| 65 |
+
while len(cases) < n:
|
| 66 |
+
prompt = " ".join(rng.choice(words) for _ in range(rng.randint(0, 5)))
|
| 67 |
+
completion = " ".join(rng.choice(words) for _ in range(rng.randint(0, 5)))
|
| 68 |
+
p = len(prompt.split()) + (rng.randint(0, 3) if rng.random() < 0.6 else 0)
|
| 69 |
+
c = len(completion.split()) + (rng.randint(0, 3) if rng.random() < 0.6 else 0)
|
| 70 |
+
cases.append([rng.choice(causes), prompt, completion, p, c])
|
| 71 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/claim_steal_priority.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Score how urgently a stalled work claim should be stolen. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/coordination/claims/work-stealing.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "claim_steal_priority",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/coordination/claims/work-stealing.ts",
|
| 6 |
+
"tags": ["scheduling", "scoring"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def claim_steal_priority(priority, stale_ms, time_to_deadline_ms, steal_count):
|
| 12 |
+
"""Return the integer steal priority of a work claim (higher = steal sooner).
|
| 13 |
+
|
| 14 |
+
score = base + staleness + deadline - 10 * steal_count, where
|
| 15 |
+
- base is 100 for "p0", 75 for "p1", 50 for "p2", 25 for "p3";
|
| 16 |
+
- staleness = min(stale_ms // 60000, 50) (whole minutes since the last update);
|
| 17 |
+
- deadline is 0 when time_to_deadline_ms is None, otherwise 50 if it is < 3600000
|
| 18 |
+
(under an hour, including overdue negatives), 25 if < 86400000, else 0.
|
| 19 |
+
Raises ValueError for an unknown priority or a negative stale_ms or steal_count.
|
| 20 |
+
"""
|
| 21 |
+
base = {"p0": 100, "p1": 75, "p2": 50, "p3": 25}
|
| 22 |
+
if priority not in base:
|
| 23 |
+
raise ValueError("unknown priority")
|
| 24 |
+
if stale_ms < 0 or steal_count < 0:
|
| 25 |
+
raise ValueError("stale_ms and steal_count must be non-negative")
|
| 26 |
+
score = base[priority] + min(stale_ms // 60000, 50)
|
| 27 |
+
if time_to_deadline_ms is not None:
|
| 28 |
+
if time_to_deadline_ms < 3600000:
|
| 29 |
+
score += 50
|
| 30 |
+
elif time_to_deadline_ms < 86400000:
|
| 31 |
+
score += 25
|
| 32 |
+
score -= steal_count * 10
|
| 33 |
+
return score
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def gen_inputs(rng, n):
|
| 37 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 38 |
+
cases = [
|
| 39 |
+
["p0", 0, None, 0],
|
| 40 |
+
["p1", 59999, None, 0],
|
| 41 |
+
["p2", 60000, None, 0],
|
| 42 |
+
["p3", 3000000, None, 0],
|
| 43 |
+
["p3", 3060000, None, 0],
|
| 44 |
+
["p3", 2999999, None, 0],
|
| 45 |
+
["p1", 0, 3599999, 0],
|
| 46 |
+
["p1", 0, 3600000, 0],
|
| 47 |
+
["p1", 0, 86399999, 0],
|
| 48 |
+
["p1", 0, 86400000, 0],
|
| 49 |
+
["p0", 0, -5000, 0],
|
| 50 |
+
["p2", 120000, 7200000, 2],
|
| 51 |
+
["p0", 0, None, 13],
|
| 52 |
+
["p4", 0, None, 0],
|
| 53 |
+
["P0", 0, None, 0],
|
| 54 |
+
["p1", -1, None, 0],
|
| 55 |
+
["p1", 0, None, -1],
|
| 56 |
+
]
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
cases.append([rng.choice(["p0", "p1", "p2", "p3"]), rng.randint(0, 4000000),
|
| 59 |
+
rng.choice([None, rng.randint(-100000, 100000000)]), rng.randint(0, 4)])
|
| 60 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/compare_versions.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compare two dotted version strings. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/mcp/tools/security-compliance/scan.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "compare_versions",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/mcp/tools/security-compliance/scan.ts",
|
| 6 |
+
"tags": ["versions", "parsing"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def parse_version(text):
|
| 12 |
+
"""Return the first three numeric components of a version string, padded with 0."""
|
| 13 |
+
if text.startswith("v"):
|
| 14 |
+
text = text[1:]
|
| 15 |
+
parts = text.split(".")[:3]
|
| 16 |
+
for part in parts:
|
| 17 |
+
if not part.isdigit():
|
| 18 |
+
raise ValueError("bad version component: " + part)
|
| 19 |
+
numbers = [int(part) for part in parts]
|
| 20 |
+
return numbers + [0] * (3 - len(numbers))
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def compare_versions(a, b):
|
| 24 |
+
"""Compare versions like "1.2.3": return -1 if a < b, 0 if equal, 1 if a > b.
|
| 25 |
+
|
| 26 |
+
One leading "v" is ignored. Only the first three dot-separated components are
|
| 27 |
+
read (later ones are ignored without validation); missing components count as 0,
|
| 28 |
+
so "1.2" equals "1.2.0". Components compare numerically ("1.10" > "1.9").
|
| 29 |
+
Raises ValueError if one of the first three components is empty or not all digits.
|
| 30 |
+
"""
|
| 31 |
+
pa, pb = parse_version(a), parse_version(b)
|
| 32 |
+
for i in range(3):
|
| 33 |
+
if pa[i] < pb[i]:
|
| 34 |
+
return -1
|
| 35 |
+
if pa[i] > pb[i]:
|
| 36 |
+
return 1
|
| 37 |
+
return 0
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def gen_inputs(rng, n):
|
| 41 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 42 |
+
cases = [
|
| 43 |
+
["1.0.0", "1.0.0"],
|
| 44 |
+
["1.2", "1.2.0"],
|
| 45 |
+
["1", "1.0.1"],
|
| 46 |
+
["1.10.0", "1.9.9"],
|
| 47 |
+
["1.9.9", "1.10.0"],
|
| 48 |
+
["2.0.0", "1.99.99"],
|
| 49 |
+
["0.0.1", "0.0.2"],
|
| 50 |
+
["0.1.0", "0.0.9"],
|
| 51 |
+
["v1.2.3", "1.2.3"],
|
| 52 |
+
["vv1.0", "1.0"],
|
| 53 |
+
["1.2.3.9", "1.2.3.1"],
|
| 54 |
+
["1.2.3", "1.2.4.x"],
|
| 55 |
+
["1..3", "1.0.3"],
|
| 56 |
+
["1.2.beta", "1.2.0"],
|
| 57 |
+
["", "0"],
|
| 58 |
+
["3.0.1", "3.0.0"],
|
| 59 |
+
["10.0.0", "9.0.0"],
|
| 60 |
+
]
|
| 61 |
+
while len(cases) < n:
|
| 62 |
+
def version():
|
| 63 |
+
return ".".join(str(rng.randint(0, 12)) for _ in range(rng.randint(1, 4)))
|
| 64 |
+
a = version()
|
| 65 |
+
b = a if rng.random() < 0.2 else version()
|
| 66 |
+
cases.append([rng.choice(["", "v"]) + a, b])
|
| 67 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/complexity_bucket.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Bucket a QE task's complexity from code-size signals. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/state_encoder.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "complexity_bucket",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/state_encoder.py",
|
| 6 |
+
"tags": ["scoring", "thresholds"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def complexity_bucket(lines_of_code, cyclomatic, num_dependencies, num_tests):
|
| 12 |
+
"""Return "simple", "moderate" or "complex" for a task context.
|
| 13 |
+
|
| 14 |
+
Points: lines_of_code > 500 adds 2, else > 100 adds 1; cyclomatic > 20 adds 2,
|
| 15 |
+
else > 10 adds 1; num_dependencies > 10 adds 1; num_tests > 100 adds 1.
|
| 16 |
+
A total of 4 or more is "complex", 2 or 3 is "moderate", 0 or 1 is "simple".
|
| 17 |
+
Raises ValueError if any argument is negative.
|
| 18 |
+
"""
|
| 19 |
+
if min(lines_of_code, cyclomatic, num_dependencies, num_tests) < 0:
|
| 20 |
+
raise ValueError("signals must be non-negative")
|
| 21 |
+
score = 0
|
| 22 |
+
if lines_of_code > 500:
|
| 23 |
+
score += 2
|
| 24 |
+
elif lines_of_code > 100:
|
| 25 |
+
score += 1
|
| 26 |
+
if cyclomatic > 20:
|
| 27 |
+
score += 2
|
| 28 |
+
elif cyclomatic > 10:
|
| 29 |
+
score += 1
|
| 30 |
+
if num_dependencies > 10:
|
| 31 |
+
score += 1
|
| 32 |
+
if num_tests > 100:
|
| 33 |
+
score += 1
|
| 34 |
+
if score >= 4:
|
| 35 |
+
return "complex"
|
| 36 |
+
if score >= 2:
|
| 37 |
+
return "moderate"
|
| 38 |
+
return "simple"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def gen_inputs(rng, n):
|
| 42 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 43 |
+
cases = [
|
| 44 |
+
[0, 0, 0, 0],
|
| 45 |
+
[100, 10, 10, 100],
|
| 46 |
+
[101, 0, 0, 0],
|
| 47 |
+
[101, 11, 0, 0],
|
| 48 |
+
[500, 20, 0, 0],
|
| 49 |
+
[501, 0, 0, 0],
|
| 50 |
+
[501, 11, 0, 0],
|
| 51 |
+
[0, 21, 0, 0],
|
| 52 |
+
[0, 21, 11, 101],
|
| 53 |
+
[0, 0, 11, 0],
|
| 54 |
+
[0, 0, 11, 101],
|
| 55 |
+
[0, 11, 0, 101],
|
| 56 |
+
[501, 21, 0, 0],
|
| 57 |
+
[101, 11, 11, 0],
|
| 58 |
+
[101, 11, 11, 101],
|
| 59 |
+
[101, 0, 0, 100],
|
| 60 |
+
[101, 0, 10, 0],
|
| 61 |
+
[-1, 0, 0, 0],
|
| 62 |
+
[0, 0, 0, -5],
|
| 63 |
+
]
|
| 64 |
+
while len(cases) < n:
|
| 65 |
+
cases.append([rng.choice([rng.randint(0, 700), rng.choice([100, 101, 500, 501])]),
|
| 66 |
+
rng.choice([rng.randint(0, 30), rng.choice([10, 11, 20, 21])]),
|
| 67 |
+
rng.randint(5, 15), rng.randint(80, 120)])
|
| 68 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/compound_interest.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Grow a deposit by compound interest with banker's rounding of each period. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "compound_interest",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["interest", "rounding", "money"],
|
| 7 |
+
"domain": "finance-economics",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def compound_interest(principal_cents, annual_rate_bp, periods_per_year, years):
|
| 12 |
+
"""Compound a deposit in integer cents, rounding each period's interest half to even.
|
| 13 |
+
|
| 14 |
+
There are periods_per_year * years periods. Each period's interest is
|
| 15 |
+
balance * annual_rate_bp / (10000 * periods_per_year) rounded to a whole cent, an exact half
|
| 16 |
+
cent going to the even neighbour (banker's rounding), and is added to the balance.
|
| 17 |
+
Returns [final_balance, total_interest, ties]; ties counts periods whose exact interest ended
|
| 18 |
+
in exactly half a cent.
|
| 19 |
+
Raises ValueError if periods_per_year is not 1, 2, 4 or 12, or if principal_cents < 0,
|
| 20 |
+
annual_rate_bp < 0, or years is outside 0..50.
|
| 21 |
+
"""
|
| 22 |
+
if periods_per_year not in (1, 2, 4, 12):
|
| 23 |
+
raise ValueError("invalid frequency")
|
| 24 |
+
if principal_cents < 0 or annual_rate_bp < 0 or years < 0 or years > 50:
|
| 25 |
+
raise ValueError("invalid terms")
|
| 26 |
+
denominator = 10000 * periods_per_year
|
| 27 |
+
balance, ties = principal_cents, 0
|
| 28 |
+
for _ in range(periods_per_year * years):
|
| 29 |
+
whole, rest = divmod(balance * annual_rate_bp, denominator)
|
| 30 |
+
if 2 * rest == denominator:
|
| 31 |
+
ties += 1
|
| 32 |
+
whole += whole % 2
|
| 33 |
+
elif 2 * rest > denominator:
|
| 34 |
+
whole += 1
|
| 35 |
+
balance += whole
|
| 36 |
+
return [balance, balance - principal_cents, ties]
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def gen_inputs(rng, n):
|
| 40 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 41 |
+
cases = [
|
| 42 |
+
[50, 10000, 1, 1],
|
| 43 |
+
[150, 10000, 1, 1],
|
| 44 |
+
[250, 10000, 1, 1],
|
| 45 |
+
[149, 10000, 1, 1],
|
| 46 |
+
[151, 10000, 1, 1],
|
| 47 |
+
[1050, 1200, 12, 1],
|
| 48 |
+
[1150, 1200, 12, 1],
|
| 49 |
+
[100000, 500, 1, 0],
|
| 50 |
+
[100000, 500, 1, 1],
|
| 51 |
+
[100000, 500, 2, 1],
|
| 52 |
+
[100000, 500, 4, 2],
|
| 53 |
+
[100000, 500, 12, 50],
|
| 54 |
+
[0, 500, 12, 10],
|
| 55 |
+
[100000, 0, 12, 10],
|
| 56 |
+
[100000, 500, 3, 1],
|
| 57 |
+
[100000, 500, 365, 1],
|
| 58 |
+
[-1, 500, 12, 1],
|
| 59 |
+
[100000, -1, 12, 1],
|
| 60 |
+
[100000, 500, 12, -1],
|
| 61 |
+
[100000, 500, 12, 51],
|
| 62 |
+
[350, 2000, 4, 3],
|
| 63 |
+
[12345, 375, 2, 7],
|
| 64 |
+
]
|
| 65 |
+
while len(cases) < n:
|
| 66 |
+
periods = rng.choice([1, 2, 4, 12])
|
| 67 |
+
rate = rng.choice([600, 1200, 2400, 10000, 400 * periods, rng.randint(1, 2500)])
|
| 68 |
+
principal = rng.randint(0, 2000) * 100 + rng.choice([50, 50, rng.randint(0, 99)])
|
| 69 |
+
cases.append([principal, rate, periods, rng.randint(0, 12)])
|
| 70 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/convert_timecode.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Convert a non-drop-frame SMPTE timecode between integer frame rates. Original."""
|
| 2 |
+
|
| 3 |
+
import re
|
| 4 |
+
|
| 5 |
+
META = {
|
| 6 |
+
"entry": "convert_timecode",
|
| 7 |
+
"origin": "Original.",
|
| 8 |
+
"tags": ["timecode", "smpte", "frame-rate"],
|
| 9 |
+
"domain": "media-content-production",
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def convert_timecode(timecode, src_fps, dst_fps):
|
| 14 |
+
"""Convert a non-drop-frame "HH:MM:SS:FF" timecode; return [dst frames, dst timecode].
|
| 15 |
+
|
| 16 |
+
Rates must be 24, 25, 30, 48, 50 or 60. Fields are two digits: HH 00-23, MM and SS
|
| 17 |
+
00-59, FF 00 to src_fps - 1. frames = ((HH * 60 + MM) * 60 + SS) * src_fps + FF becomes
|
| 18 |
+
frames * dst_fps // src_fps (rounded down) at dst_fps, written back as "HH:MM:SS:FF".
|
| 19 |
+
Raises ValueError for another rate, a malformed timecode or a field out of range.
|
| 20 |
+
"""
|
| 21 |
+
for fps in (src_fps, dst_fps):
|
| 22 |
+
if fps not in (24, 25, 30, 48, 50, 60):
|
| 23 |
+
raise ValueError("unsupported frame rate")
|
| 24 |
+
match = re.fullmatch(r"(\d\d):(\d\d):(\d\d):(\d\d)", timecode)
|
| 25 |
+
if not match:
|
| 26 |
+
raise ValueError("timecode must be HH:MM:SS:FF")
|
| 27 |
+
hours, minutes, seconds, frame = (int(part) for part in match.groups())
|
| 28 |
+
if hours > 23 or minutes > 59 or seconds > 59 or frame >= src_fps:
|
| 29 |
+
raise ValueError("field out of range")
|
| 30 |
+
count = ((hours * 60 + minutes) * 60 + seconds) * src_fps + frame
|
| 31 |
+
frames = count * dst_fps // src_fps
|
| 32 |
+
whole, frame = divmod(frames, dst_fps)
|
| 33 |
+
return [frames, "%02d:%02d:%02d:%02d" % (whole // 3600, whole // 60 % 60, whole % 60, frame)]
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def gen_inputs(rng, n):
|
| 37 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 38 |
+
cases = [
|
| 39 |
+
["00:00:00:00", 24, 25],
|
| 40 |
+
["01:00:00:00", 25, 30],
|
| 41 |
+
["00:00:01:23", 24, 48],
|
| 42 |
+
["00:00:01:24", 24, 48],
|
| 43 |
+
["00:00:01:29", 30, 25],
|
| 44 |
+
["00:00:01:12", 25, 24],
|
| 45 |
+
["23:59:59:59", 60, 50],
|
| 46 |
+
["24:00:00:00", 25, 25],
|
| 47 |
+
["00:60:00:00", 25, 25],
|
| 48 |
+
["00:00:60:00", 25, 25],
|
| 49 |
+
["00:59:59:24", 25, 60],
|
| 50 |
+
["10:10:10:10", 23, 25],
|
| 51 |
+
["10:10:10:10", 25, 29],
|
| 52 |
+
["1:00:00:00", 25, 25],
|
| 53 |
+
["01:00:00;00", 30, 30],
|
| 54 |
+
["12:34:56:07", 30, 24],
|
| 55 |
+
]
|
| 56 |
+
rates = [24, 25, 30, 48, 50, 60]
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
src, dst = rng.choice(rates), rng.choice(rates + [29] if rng.random() < 0.1 else rates)
|
| 59 |
+
hours = rng.choice([0, 0, 0, 1, rng.randint(0, 23)]) # most clips are under an hour
|
| 60 |
+
last_frame = src - 1 if rng.random() < 0.9 else src # sometimes one frame too many
|
| 61 |
+
parts = [hours, rng.choice([0, rng.randint(0, 59)]), rng.randint(0, 59), rng.randint(0, last_frame)]
|
| 62 |
+
cases.append([":".join("%02d" % p for p in parts), src, dst])
|
| 63 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/coverage_gap_severity.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Rate the severity of an uncovered code range. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/domains/coverage-analysis/services/coverage-parser.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "coverage_gap_severity",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/domains/coverage-analysis/services/coverage-parser.ts",
|
| 6 |
+
"tags": ["coverage", "thresholds"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def coverage_gap_severity(range_size, total_lines):
|
| 12 |
+
"""Return "critical", "high", "medium" or "low" for an uncovered range.
|
| 13 |
+
|
| 14 |
+
percentage = range_size * 100 / total_lines (exact, not rounded).
|
| 15 |
+
- percentage > 20 or range_size > 50 -> "critical"
|
| 16 |
+
- percentage > 10 or range_size > 20 -> "high"
|
| 17 |
+
- percentage > 5 or range_size > 10 -> "medium"
|
| 18 |
+
- otherwise "low".
|
| 19 |
+
Raises ValueError if total_lines < 1, range_size < 0 or range_size > total_lines.
|
| 20 |
+
"""
|
| 21 |
+
if total_lines < 1 or range_size < 0 or range_size > total_lines:
|
| 22 |
+
raise ValueError("invalid range")
|
| 23 |
+
percentage = range_size * 100 / total_lines
|
| 24 |
+
if percentage > 20 or range_size > 50:
|
| 25 |
+
return "critical"
|
| 26 |
+
if percentage > 10 or range_size > 20:
|
| 27 |
+
return "high"
|
| 28 |
+
if percentage > 5 or range_size > 10:
|
| 29 |
+
return "medium"
|
| 30 |
+
return "low"
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def gen_inputs(rng, n):
|
| 34 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 35 |
+
cases = [
|
| 36 |
+
[0, 1],
|
| 37 |
+
[1, 5],
|
| 38 |
+
[1, 4],
|
| 39 |
+
[10, 100],
|
| 40 |
+
[11, 100],
|
| 41 |
+
[20, 200],
|
| 42 |
+
[21, 200],
|
| 43 |
+
[5, 100],
|
| 44 |
+
[6, 100],
|
| 45 |
+
[50, 1000],
|
| 46 |
+
[51, 1000],
|
| 47 |
+
[20, 1000],
|
| 48 |
+
[21, 1000],
|
| 49 |
+
[10, 1000],
|
| 50 |
+
[11, 1000],
|
| 51 |
+
[21, 100],
|
| 52 |
+
[5, 0],
|
| 53 |
+
[-1, 10],
|
| 54 |
+
[11, 10],
|
| 55 |
+
]
|
| 56 |
+
while len(cases) < n:
|
| 57 |
+
total = rng.choice([rng.randint(1, 100), rng.randint(100, 2000)])
|
| 58 |
+
cases.append([rng.randint(0, min(total, 80)), total])
|
| 59 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/crop_to_aspect.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Center-crop an image to a target aspect ratio and report which dimension was cut. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "crop_to_aspect",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["aspect-ratio", "image", "crop"],
|
| 7 |
+
"domain": "media-content-production",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def crop_to_aspect(src_w, src_h, aspect_w, aspect_h):
|
| 12 |
+
"""Center-crop a src_w x src_h image to the aspect_w:aspect_h shape; return [x, y, w, h, cut].
|
| 13 |
+
|
| 14 |
+
Let wide = src_w * aspect_h and tall = aspect_w * src_h; divisions round down. If
|
| 15 |
+
wide > tall the width is cut: w = src_h * aspect_w // aspect_h, h = src_h, cut "width".
|
| 16 |
+
If wide < tall the height is cut: w = src_w, h = src_w * aspect_h // aspect_w, cut
|
| 17 |
+
"height". Otherwise the whole image is kept, cut "none". The box is centered:
|
| 18 |
+
x = (src_w - w) // 2, y = (src_h - h) // 2. Raises ValueError if any argument is below 1.
|
| 19 |
+
"""
|
| 20 |
+
if min(src_w, src_h, aspect_w, aspect_h) < 1:
|
| 21 |
+
raise ValueError("sizes must be >= 1")
|
| 22 |
+
wide, tall = src_w * aspect_h, aspect_w * src_h
|
| 23 |
+
if wide > tall:
|
| 24 |
+
w, h, cut = src_h * aspect_w // aspect_h, src_h, "width"
|
| 25 |
+
elif wide < tall:
|
| 26 |
+
w, h, cut = src_w, src_w * aspect_h // aspect_w, "height"
|
| 27 |
+
else:
|
| 28 |
+
w, h, cut = src_w, src_h, "none"
|
| 29 |
+
return [(src_w - w) // 2, (src_h - h) // 2, w, h, cut]
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def gen_inputs(rng, n):
|
| 33 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 34 |
+
cases = [
|
| 35 |
+
[1920, 1080, 16, 9],
|
| 36 |
+
[1920, 1080, 4, 3],
|
| 37 |
+
[1920, 1080, 9, 16],
|
| 38 |
+
[4000, 3000, 16, 9],
|
| 39 |
+
[1080, 1920, 1, 1],
|
| 40 |
+
[1080, 1080, 1, 1],
|
| 41 |
+
[2560, 1080, 64, 27],
|
| 42 |
+
[1, 1, 1, 1],
|
| 43 |
+
[1, 3, 2, 1],
|
| 44 |
+
[3, 1, 1, 2],
|
| 45 |
+
[1001, 600, 5, 3],
|
| 46 |
+
[1000, 601, 5, 3],
|
| 47 |
+
[0, 1080, 16, 9],
|
| 48 |
+
[1920, 1080, 16, 0],
|
| 49 |
+
]
|
| 50 |
+
aspects = [[16, 9], [4, 3], [1, 1], [9, 16], [21, 9], [2, 1], [3, 2], [4, 5]]
|
| 51 |
+
sizes = [1, 2, 3, 5, 7, 16, 100, 333, 720, 1080, 1280, 1920, 2160, 3840]
|
| 52 |
+
while len(cases) < n:
|
| 53 |
+
dims = [rng.choice(sizes) if rng.random() < 0.3 else rng.randint(1, 4000) for _ in range(2)]
|
| 54 |
+
aspect = rng.choice(aspects) if rng.random() < 0.7 else [rng.randint(1, 30), rng.randint(1, 30)]
|
| 55 |
+
cases.append(dims + aspect)
|
| 56 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/debounce_switch.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Debounce an analogue sensor into an on/off signal with hysteresis. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "debounce_switch",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["sensor", "debounce", "hysteresis"],
|
| 7 |
+
"domain": "industrial-physical-systems",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def debounce_switch(samples, low, high, hold):
|
| 12 |
+
"""Turn sensor samples into a debounced on/off state with hysteresis.
|
| 13 |
+
|
| 14 |
+
The state starts off. While off, it turns on once `hold` consecutive samples are >= high; while
|
| 15 |
+
on, it turns off once `hold` consecutive samples are <= low. A sample that does not continue
|
| 16 |
+
the run resets the count to zero, and the count restarts at zero after every change.
|
| 17 |
+
Returns [final_state, changes]; changes lists [index, state] for every change, index being the
|
| 18 |
+
position of the sample that completed the run.
|
| 19 |
+
Raises ValueError if low >= high or hold < 1.
|
| 20 |
+
"""
|
| 21 |
+
if low >= high or hold < 1:
|
| 22 |
+
raise ValueError("invalid debounce settings")
|
| 23 |
+
state, run, changes = False, 0, []
|
| 24 |
+
for index, sample in enumerate(samples):
|
| 25 |
+
crossing = sample <= low if state else sample >= high
|
| 26 |
+
run = run + 1 if crossing else 0
|
| 27 |
+
if run >= hold:
|
| 28 |
+
state, run = not state, 0
|
| 29 |
+
changes.append([index, state])
|
| 30 |
+
return [state, changes]
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def gen_inputs(rng, n):
|
| 34 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 35 |
+
cases = [
|
| 36 |
+
[[], 10, 20, 1],
|
| 37 |
+
[[20], 10, 20, 1],
|
| 38 |
+
[[19], 10, 20, 1],
|
| 39 |
+
[[21, 9], 10, 20, 1],
|
| 40 |
+
[[21, 10], 10, 20, 1],
|
| 41 |
+
[[21, 11], 10, 20, 1],
|
| 42 |
+
[[25, 25], 10, 20, 2],
|
| 43 |
+
[[25, 15, 25], 10, 20, 2],
|
| 44 |
+
[[25, 25, 25, 5, 5], 10, 20, 2],
|
| 45 |
+
[[25, 25, 5, 25, 5, 5], 10, 20, 2],
|
| 46 |
+
[[25, 25, 25, 25], 10, 20, 3],
|
| 47 |
+
[[30, 0, 30, 0], 10, 20, 1],
|
| 48 |
+
[[15, 15, 15], 10, 20, 1],
|
| 49 |
+
[[5, 5, 5], 10, 20, 1],
|
| 50 |
+
[[25], 20, 20, 1],
|
| 51 |
+
[[25], 21, 20, 1],
|
| 52 |
+
[[25], 10, 20, 0],
|
| 53 |
+
[[0, 100, 100, 100, 0, 0, 0, 0], 40, 60, 3],
|
| 54 |
+
[[1], -5, 0, 0],
|
| 55 |
+
[[1], 0, 5, 0],
|
| 56 |
+
]
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
low = rng.randint(0, 50)
|
| 59 |
+
high = low + rng.randint(1, 30)
|
| 60 |
+
samples = [rng.choice([rng.randint(low - 10, low), rng.randint(high, high + 10), rng.randint(low, high)])
|
| 61 |
+
for _ in range(rng.randint(1, 12))]
|
| 62 |
+
cases.append([samples, low, high, rng.choice([1, 1, 2, 2, 3])])
|
| 63 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/decay_table.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tabulate a decaying activity in integer counts and find its half-life step. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "decay_table",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["simulation", "decay", "integer-arithmetic"],
|
| 7 |
+
"domain": "natural-science",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def decay_table(activity, keep_num, keep_den, threshold, max_steps):
|
| 12 |
+
"""Tabulate a first-order decay (radioactive source or drug dose), one level per time step.
|
| 13 |
+
|
| 14 |
+
Each step multiplies the previous activity by keep_num / keep_den, the fraction retained per
|
| 15 |
+
step, and rounds down to an integer count. Steps continue while the current activity is
|
| 16 |
+
>= threshold and fewer than max_steps steps have been taken, so the first activity below
|
| 17 |
+
threshold is the last one listed and at most max_steps steps are listed.
|
| 18 |
+
Returns [levels, h]: levels[k] is the activity after k steps (levels[0] is the initial
|
| 19 |
+
activity), and h is the first step k >= 1 with 2 * levels[k] <= levels[0], or None if no
|
| 20 |
+
listed step reaches it.
|
| 21 |
+
Raises ValueError if activity < 0, threshold < 1, max_steps < 0, or unless
|
| 22 |
+
0 <= keep_num < keep_den.
|
| 23 |
+
"""
|
| 24 |
+
if activity < 0 or threshold < 1 or max_steps < 0:
|
| 25 |
+
raise ValueError("bad table parameters")
|
| 26 |
+
if not 0 <= keep_num < keep_den:
|
| 27 |
+
raise ValueError("the retained fraction must be in [0, 1)")
|
| 28 |
+
levels = [activity]
|
| 29 |
+
half_life_step = None
|
| 30 |
+
current, step = activity, 0
|
| 31 |
+
while current >= threshold and step < max_steps:
|
| 32 |
+
step += 1
|
| 33 |
+
current = current * keep_num // keep_den
|
| 34 |
+
levels.append(current)
|
| 35 |
+
if half_life_step is None and 2 * current <= activity:
|
| 36 |
+
half_life_step = step
|
| 37 |
+
return [levels, half_life_step]
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def gen_inputs(rng, n):
|
| 41 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 42 |
+
cases = [
|
| 43 |
+
[1000, 1, 2, 100, 20], [1000, 9, 10, 1, 0], [1000, 9, 10, 1, 1], [1000, 9, 10, 500, 30],
|
| 44 |
+
[0, 1, 2, 1, 5], [-1, 1, 2, 1, 5], [100, 1, 2, 0, 5], [100, 1, 2, 1, -1],
|
| 45 |
+
[100, 0, 3, 1, 5], [100, 3, 3, 1, 5], [100, -1, 3, 1, 5], [100, 4, 3, 1, 5],
|
| 46 |
+
[64, 1, 2, 1, 10], [64, 1, 2, 64, 10], [64, 1, 2, 65, 10], [7, 2, 3, 2, 10],
|
| 47 |
+
[10, 1, 2, 5, 10], [11, 1, 2, 6, 10], [1, 1, 2, 1, 3], [500, 7, 8, 100, 4],
|
| 48 |
+
]
|
| 49 |
+
while len(cases) < n:
|
| 50 |
+
den = rng.randint(2, 12)
|
| 51 |
+
steps = rng.randint(0, 5) if rng.random() < 0.6 else rng.randint(6, 25)
|
| 52 |
+
cases.append([rng.randint(0, rng.choice([200, 5000])), rng.randint(0, den - 1), den,
|
| 53 |
+
rng.randint(1, 120), steps])
|
| 54 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/efficiency_reward.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Reward an agent for finishing faster and cheaper than estimated. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/reward_calculator.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "efficiency_reward",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/reward_calculator.py",
|
| 6 |
+
"tags": ["reward", "clamping"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def efficiency_reward(actual_seconds, expected_seconds, actual_cost, estimated_cost):
|
| 12 |
+
"""Return [time_reward, cost_reward], each rounded to 2 decimals.
|
| 13 |
+
|
| 14 |
+
time_reward: 0.0 if actual_seconds <= 0; otherwise
|
| 15 |
+
(expected_seconds / actual_seconds - 1) * 50 clamped to [-50, 50].
|
| 16 |
+
cost_reward: 0.0 if actual_cost <= 0; otherwise
|
| 17 |
+
(estimated_cost / actual_cost - 1) * 50 clamped to [-25, 50].
|
| 18 |
+
The clamps are inclusive: values outside are replaced by the nearest bound.
|
| 19 |
+
Rounding is Python's round(x, 2): an exact half goes to the even digit, so
|
| 20 |
+
actual_seconds 16 with expected_seconds 3 gives -40.625 -> -40.62.
|
| 21 |
+
"""
|
| 22 |
+
if actual_seconds <= 0:
|
| 23 |
+
time_reward = 0.0
|
| 24 |
+
else:
|
| 25 |
+
time_reward = (expected_seconds / actual_seconds - 1.0) * 50.0
|
| 26 |
+
time_reward = max(-50.0, min(time_reward, 50.0))
|
| 27 |
+
if actual_cost <= 0:
|
| 28 |
+
cost_reward = 0.0
|
| 29 |
+
else:
|
| 30 |
+
cost_reward = (estimated_cost / actual_cost - 1.0) * 50.0
|
| 31 |
+
cost_reward = max(-25.0, min(cost_reward, 50.0))
|
| 32 |
+
return [round(time_reward, 2), round(cost_reward, 2)]
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def gen_inputs(rng, n):
|
| 36 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 37 |
+
cases = [
|
| 38 |
+
[0, 10, 0, 10],
|
| 39 |
+
[-5, 10, -1, 10],
|
| 40 |
+
[10, 10, 10, 10],
|
| 41 |
+
[5, 10, 5, 10],
|
| 42 |
+
[4, 10, 4, 10],
|
| 43 |
+
[20, 10, 20, 10],
|
| 44 |
+
[30, 10, 30, 10],
|
| 45 |
+
[11, 10, 11, 10],
|
| 46 |
+
[8, 10, 8, 10],
|
| 47 |
+
[100, 1, 100, 1],
|
| 48 |
+
[1, 100, 1, 100],
|
| 49 |
+
[40, 30, 3, 2],
|
| 50 |
+
[7, 9, 15, 12],
|
| 51 |
+
]
|
| 52 |
+
while len(cases) < n:
|
| 53 |
+
cases.append([rng.randint(0, 40), rng.randint(1, 40), rng.randint(0, 40), rng.randint(1, 40)])
|
| 54 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/expense_violations.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Check expense claim lines against a travel-and-expense policy. Original."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "expense_violations",
|
| 5 |
+
"origin": "Original.",
|
| 6 |
+
"tags": ["expenses", "policy", "compliance"],
|
| 7 |
+
"domain": "office-white-collar",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def expense_violations(items):
|
| 12 |
+
"""Return one day's expense-policy violations as [index, code] pairs.
|
| 13 |
+
|
| 14 |
+
items are [category, cents, receipt] lines, checked in order; a line adds its codes
|
| 15 |
+
in this order: "OVER_CAP" if cents exceed the cap (meal 7500, hotel 25000, taxi 6000,
|
| 16 |
+
other 10000); "NO_RECEIPT" if cents >= 2500 and receipt is false; "DAILY_MEALS" for a
|
| 17 |
+
meal after which the day's meal total so far exceeds 10000. Raises ValueError at the
|
| 18 |
+
first line with an unknown category or cents <= 0.
|
| 19 |
+
"""
|
| 20 |
+
caps = {"meal": 7500, "hotel": 25000, "taxi": 6000, "other": 10000}
|
| 21 |
+
meals, found = 0, []
|
| 22 |
+
for index, (category, cents, receipt) in enumerate(items):
|
| 23 |
+
if category not in caps:
|
| 24 |
+
raise ValueError("unknown category")
|
| 25 |
+
if cents <= 0:
|
| 26 |
+
raise ValueError("cents must be positive")
|
| 27 |
+
if cents > caps[category]:
|
| 28 |
+
found.append([index, "OVER_CAP"])
|
| 29 |
+
if cents >= 2500 and not receipt:
|
| 30 |
+
found.append([index, "NO_RECEIPT"])
|
| 31 |
+
if category == "meal":
|
| 32 |
+
meals += cents
|
| 33 |
+
if meals > 10000:
|
| 34 |
+
found.append([index, "DAILY_MEALS"])
|
| 35 |
+
return found
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def gen_inputs(rng, n):
|
| 39 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 40 |
+
cases = [
|
| 41 |
+
[[]],
|
| 42 |
+
[[["meal", 7500, True]]],
|
| 43 |
+
[[["meal", 7501, True]]],
|
| 44 |
+
[[["hotel", 25000, True], ["hotel", 25001, True]]],
|
| 45 |
+
[[["taxi", 6000, True], ["taxi", 6001, True]]],
|
| 46 |
+
[[["other", 10000, True], ["other", 10001, True]]],
|
| 47 |
+
[[["taxi", 2499, False], ["taxi", 2500, False]]],
|
| 48 |
+
[[["meal", 1, False], ["meal", 9999, True]]],
|
| 49 |
+
[[["meal", 4000, True], ["meal", 6001, True]]],
|
| 50 |
+
[[["meal", 3000, False], ["hotel", 30000, False]]],
|
| 51 |
+
[[["taxi", 1200, True], ["meal", 0, True]]],
|
| 52 |
+
[[["taxi", 1200, True], ["bar", 900, True]]],
|
| 53 |
+
[[["meal", -5, True]]],
|
| 54 |
+
]
|
| 55 |
+
categories = ["meal", "meal", "hotel", "taxi", "other"]
|
| 56 |
+
while len(cases) < n:
|
| 57 |
+
claim = []
|
| 58 |
+
for _ in range(rng.choice([1, 2, 2, 3])):
|
| 59 |
+
cents = rng.choice([rng.randint(1, 4000), rng.randint(2000, 12000), rng.randint(5000, 32000)])
|
| 60 |
+
claim.append([rng.choice(categories), cents, rng.random() < 0.7])
|
| 61 |
+
cases.append([claim])
|
| 62 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/find_stop.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Find where generated text is cut at the earliest stop sequence. Ported from Rust; adapted from ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs (MIT)."""
|
| 2 |
+
|
| 3 |
+
PRE_FIX = "ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs"
|
| 4 |
+
META = {
|
| 5 |
+
"entry": "find_stop",
|
| 6 |
+
"origin": "ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs",
|
| 7 |
+
"tags": ["llm", "strings", "streaming"],
|
| 8 |
+
"domain": "software-engineering",
|
| 9 |
+
"real_faults": [
|
| 10 |
+
{"id": "find_stop/first-listed", "kind": "first-match-vs-best", "origin": PRE_FIX,
|
| 11 |
+
"summary": "cuts at the first stop sequence in list order that occurs, not at the earliest offset",
|
| 12 |
+
"find": " if pos != -1 and (earliest is None or pos < earliest):\n earliest = pos\n",
|
| 13 |
+
"replace": " if pos != -1:\n return pos\n"},
|
| 14 |
+
{"id": "find_stop/empty-matches", "kind": "missing-guard", "origin": PRE_FIX,
|
| 15 |
+
"summary": "an empty stop sequence matches at offset 0, so the whole output is cut",
|
| 16 |
+
"find": " if not stop:\n continue\n", "replace": ""},
|
| 17 |
+
],
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def find_stop(text, stop_sequences):
|
| 22 |
+
"""Return the offset in text where the earliest stop sequence starts, or None.
|
| 23 |
+
|
| 24 |
+
Every non-empty string in stop_sequences is searched for in text. The result is the
|
| 25 |
+
smallest index at which any of them occurs (0 means the whole text is cut away).
|
| 26 |
+
The order of stop_sequences does not matter. Empty stop sequences never match.
|
| 27 |
+
Returns None when no non-empty stop sequence occurs, including for an empty list.
|
| 28 |
+
"""
|
| 29 |
+
earliest = None
|
| 30 |
+
for stop in stop_sequences:
|
| 31 |
+
if not stop:
|
| 32 |
+
continue
|
| 33 |
+
pos = text.find(stop)
|
| 34 |
+
if pos != -1 and (earliest is None or pos < earliest):
|
| 35 |
+
earliest = pos
|
| 36 |
+
return earliest
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def gen_inputs(rng, n):
|
| 40 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 41 |
+
cases = [
|
| 42 |
+
["", []],
|
| 43 |
+
["hello", []],
|
| 44 |
+
["hello", ["lo", "l"]],
|
| 45 |
+
["hello", ["", "lo", "l"]],
|
| 46 |
+
["hey", ["", "lo", "l"]],
|
| 47 |
+
["abc", [""]],
|
| 48 |
+
["", ["a"]],
|
| 49 |
+
["abcabc", ["c", "b"]],
|
| 50 |
+
["abcabc", ["b", "c"]],
|
| 51 |
+
["a\nUser: hi", ["User:", "\n"]],
|
| 52 |
+
["done</s>more", ["</s>", "<im_end>"]],
|
| 53 |
+
["x<im_end>y</s>", ["</s>", "<im_end>"]],
|
| 54 |
+
["aaaa", ["aa", "a"]],
|
| 55 |
+
]
|
| 56 |
+
alphabet = "abcab\n "
|
| 57 |
+
while len(cases) < n:
|
| 58 |
+
text = "".join(rng.choice(alphabet) for _ in range(rng.randint(0, 16)))
|
| 59 |
+
stops = []
|
| 60 |
+
for _ in range(rng.randint(0, 3)):
|
| 61 |
+
if rng.random() < 0.12:
|
| 62 |
+
stops.append("")
|
| 63 |
+
else:
|
| 64 |
+
stops.append("".join(rng.choice("abc\n") for _ in range(rng.randint(1, 3))))
|
| 65 |
+
cases.append([text, stops])
|
| 66 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/flakiness_pattern.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Classify the flakiness pattern of repeated test runs. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/agents/flaky_test_hunter.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "flakiness_pattern",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/agents/flaky_test_hunter.py",
|
| 6 |
+
"tags": ["flaky-tests", "sequences"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def flakiness_pattern(results):
|
| 12 |
+
"""Classify a sequence of test outcomes (True = passed) from repeated runs.
|
| 13 |
+
|
| 14 |
+
Let n = len(results) and let the longest consecutive run of passes and of failures
|
| 15 |
+
be max_pass and max_fail.
|
| 16 |
+
- Empty list -> "UNKNOWN".
|
| 17 |
+
- max_pass == n -> "STABLE_PASS"; max_fail == n -> "STABLE_FAIL".
|
| 18 |
+
- max_pass or max_fail strictly greater than 70% of n (x * 10 > n * 7)
|
| 19 |
+
-> "INTERMITTENT".
|
| 20 |
+
- Otherwise -> "RANDOM".
|
| 21 |
+
"""
|
| 22 |
+
if not results:
|
| 23 |
+
return "UNKNOWN"
|
| 24 |
+
passes = fails = max_pass = max_fail = 0
|
| 25 |
+
for passed in results:
|
| 26 |
+
if passed:
|
| 27 |
+
passes += 1
|
| 28 |
+
fails = 0
|
| 29 |
+
max_pass = max(max_pass, passes)
|
| 30 |
+
else:
|
| 31 |
+
fails += 1
|
| 32 |
+
passes = 0
|
| 33 |
+
max_fail = max(max_fail, fails)
|
| 34 |
+
total = len(results)
|
| 35 |
+
if max_pass == total:
|
| 36 |
+
return "STABLE_PASS"
|
| 37 |
+
if max_fail == total:
|
| 38 |
+
return "STABLE_FAIL"
|
| 39 |
+
if max_pass * 10 > total * 7 or max_fail * 10 > total * 7:
|
| 40 |
+
return "INTERMITTENT"
|
| 41 |
+
return "RANDOM"
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def gen_inputs(rng, n):
|
| 45 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 46 |
+
T, F = True, False
|
| 47 |
+
cases = [
|
| 48 |
+
[[]],
|
| 49 |
+
[[T]],
|
| 50 |
+
[[F]],
|
| 51 |
+
[[T, T, T]],
|
| 52 |
+
[[F, F, F, F]],
|
| 53 |
+
[[T, F]],
|
| 54 |
+
[[T, T, T, F]],
|
| 55 |
+
[[F, T, T, T]],
|
| 56 |
+
[[T, T, T, T, T, T, T, F, F, F]],
|
| 57 |
+
[[T, T, T, T, T, T, T, T, F, F]],
|
| 58 |
+
[[F, F, F, F, F, F, F, F, T, T]],
|
| 59 |
+
[[F, F, F, F, F, F, F, T, T, T]],
|
| 60 |
+
[[T, F, T, F, T, F]],
|
| 61 |
+
[[T, T, F, F, T, T]],
|
| 62 |
+
[[F, T, F, F, F, F]],
|
| 63 |
+
[[T, F, F, F, F, F, F, F, F]],
|
| 64 |
+
]
|
| 65 |
+
while len(cases) < n:
|
| 66 |
+
bias = rng.random()
|
| 67 |
+
cases.append([[rng.random() < bias for _ in range(rng.randint(1, 12))]])
|
| 68 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/flaky_hunter_reward.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Reward a flaky-test hunter with an F1 score minus miss penalties. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/reward_calculator.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "flaky_hunter_reward",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/learning/reward_calculator.py",
|
| 6 |
+
"tags": ["flaky-tests", "metrics", "reward"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def flaky_hunter_reward(true_positives, false_positives, false_negatives):
|
| 12 |
+
"""Reward for a flaky-test detector, rounded to 2 decimals.
|
| 13 |
+
|
| 14 |
+
precision = tp / (tp + fp), or 0.0 when tp + fp == 0.
|
| 15 |
+
recall = tp / (tp + fn), or 0.0 when tp + fn == 0.
|
| 16 |
+
f1 = 2 * precision * recall / (precision + recall), or 0.0 when both are 0.
|
| 17 |
+
reward = f1 * 100 - 20 * false_negatives - 5 * false_positives (may be negative).
|
| 18 |
+
Raises ValueError if any count is negative.
|
| 19 |
+
"""
|
| 20 |
+
tp, fp, fn = true_positives, false_positives, false_negatives
|
| 21 |
+
if min(tp, fp, fn) < 0:
|
| 22 |
+
raise ValueError("counts must be non-negative")
|
| 23 |
+
precision = tp / (tp + fp) if tp + fp > 0 else 0.0
|
| 24 |
+
recall = tp / (tp + fn) if tp + fn > 0 else 0.0
|
| 25 |
+
if precision + recall > 0:
|
| 26 |
+
f1 = 2 * precision * recall / (precision + recall)
|
| 27 |
+
else:
|
| 28 |
+
f1 = 0.0
|
| 29 |
+
reward = f1 * 100.0
|
| 30 |
+
reward -= fn * 20.0
|
| 31 |
+
reward -= fp * 5.0
|
| 32 |
+
return round(reward, 2)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def gen_inputs(rng, n):
|
| 36 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 37 |
+
cases = [
|
| 38 |
+
[0, 0, 0],
|
| 39 |
+
[1, 0, 0],
|
| 40 |
+
[0, 1, 0],
|
| 41 |
+
[0, 0, 1],
|
| 42 |
+
[3, 1, 0],
|
| 43 |
+
[3, 0, 1],
|
| 44 |
+
[2, 2, 2],
|
| 45 |
+
[5, 1, 2],
|
| 46 |
+
[1, 4, 0],
|
| 47 |
+
[10, 0, 3],
|
| 48 |
+
[-1, 0, 0],
|
| 49 |
+
[0, 0, -2],
|
| 50 |
+
]
|
| 51 |
+
while len(cases) < n:
|
| 52 |
+
cases.append([rng.randint(0, 10), rng.randint(0, 4), rng.randint(0, 4)])
|
| 53 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/flaky_run_summary.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Summarize repeated runs of one test into a flakiness verdict. Adapted from proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/agents/flaky_test_hunter.py (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "flaky_run_summary",
|
| 5 |
+
"origin": "proffesor-for-testing/lionagi-qe-fleet@ce1d58750a240a16c3c53abcb8a7c73864e98c99:src/lionagi_qe/agents/flaky_test_hunter.py",
|
| 6 |
+
"tags": ["flaky-tests", "statistics"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def flaky_run_summary(results, iterations):
|
| 12 |
+
"""Summarize `iterations` runs of one test; results lists the outcomes seen (True = passed).
|
| 13 |
+
|
| 14 |
+
Runs missing from results (when len(results) < iterations) count as failures.
|
| 15 |
+
Returns {"passed", "failed", "is_flaky", "flakiness_pct", "pass_rate_pct"} where
|
| 16 |
+
passed = number of True values, failed = iterations - passed,
|
| 17 |
+
is_flaky = 0 < passed < iterations,
|
| 18 |
+
flakiness_pct = min(passed, failed) * 200 // iterations (integer division, 0..100),
|
| 19 |
+
pass_rate_pct = round(passed * 100 / iterations, 1).
|
| 20 |
+
Raises ValueError if iterations < 1 or len(results) > iterations.
|
| 21 |
+
"""
|
| 22 |
+
if iterations < 1:
|
| 23 |
+
raise ValueError("iterations must be positive")
|
| 24 |
+
if len(results) > iterations:
|
| 25 |
+
raise ValueError("more results than iterations")
|
| 26 |
+
passed = sum(1 for r in results if r)
|
| 27 |
+
failed = iterations - passed
|
| 28 |
+
return {
|
| 29 |
+
"passed": passed,
|
| 30 |
+
"failed": failed,
|
| 31 |
+
"is_flaky": 0 < passed < iterations,
|
| 32 |
+
"flakiness_pct": min(passed, failed) * 200 // iterations,
|
| 33 |
+
"pass_rate_pct": round(passed * 100 / iterations, 1),
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def gen_inputs(rng, n):
|
| 38 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 39 |
+
T, F = True, False
|
| 40 |
+
cases = [
|
| 41 |
+
[[], 1],
|
| 42 |
+
[[T], 1],
|
| 43 |
+
[[F], 1],
|
| 44 |
+
[[T, F], 2],
|
| 45 |
+
[[T, T], 2],
|
| 46 |
+
[[T], 2],
|
| 47 |
+
[[T, T, F], 3],
|
| 48 |
+
[[T, F, F], 3],
|
| 49 |
+
[[T, T, T, F, F, F, T], 7],
|
| 50 |
+
[[T, T, T], 7],
|
| 51 |
+
[[], 0],
|
| 52 |
+
[[T, T], 1],
|
| 53 |
+
[[T, F, T, T, T, T, T, T, T, T, T, T], 12],
|
| 54 |
+
]
|
| 55 |
+
while len(cases) < n:
|
| 56 |
+
k = rng.randint(1, 12)
|
| 57 |
+
cases.append([[rng.random() < 0.6 for _ in range(rng.randint(0, k))], k])
|
| 58 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/format_duration.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Format a duration in milliseconds for CLI output. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/cli/handlers/interfaces.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
META = {
|
| 4 |
+
"entry": "format_duration",
|
| 5 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/cli/handlers/interfaces.ts",
|
| 6 |
+
"tags": ["formatting", "durations", "thresholds"],
|
| 7 |
+
"domain": "software-engineering",
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def one_decimal(ms, unit):
|
| 12 |
+
"""ms / unit rounded half up to one decimal place, as text (exact integer arithmetic)."""
|
| 13 |
+
tenths = (ms * 10 + unit // 2) // unit
|
| 14 |
+
return str(tenths // 10) + "." + str(tenths % 10)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def format_duration(ms):
|
| 18 |
+
"""Render a non-negative integer millisecond duration as a short string.
|
| 19 |
+
|
| 20 |
+
ms < 1000 -> "<ms>ms"; ms < 60000 -> seconds + "s"; ms < 3600000 -> minutes + "m";
|
| 21 |
+
otherwise hours + "h". Seconds, minutes and hours have exactly one decimal, rounded
|
| 22 |
+
half up from the exact value: 1500 -> "1.5s", 1450 -> "1.5s", 14350 -> "14.4s",
|
| 23 |
+
59999 -> "60.0s", 90000 -> "1.5m". Raises ValueError if ms is negative.
|
| 24 |
+
"""
|
| 25 |
+
if ms < 0:
|
| 26 |
+
raise ValueError("duration must be non-negative")
|
| 27 |
+
if ms < 1000:
|
| 28 |
+
return str(ms) + "ms"
|
| 29 |
+
if ms < 60000:
|
| 30 |
+
return one_decimal(ms, 1000) + "s"
|
| 31 |
+
if ms < 3600000:
|
| 32 |
+
return one_decimal(ms, 60000) + "m"
|
| 33 |
+
return one_decimal(ms, 3600000) + "h"
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def gen_inputs(rng, n):
|
| 37 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 38 |
+
cases = [[0], [999], [1000], [1500], [59999], [60000], [90000], [3599999],
|
| 39 |
+
[3600000], [5400000], [86400000], [-1], [12345], [654321]]
|
| 40 |
+
while len(cases) < n:
|
| 41 |
+
cases.append([rng.choice([rng.randint(0, 2000), rng.randint(0, 120000), rng.randint(0, 20000000)])])
|
| 42 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/gguf_loader.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Choose the weight loader for a GGUF model file from its metadata. Ported from Rust; adapted from ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs (MIT)."""
|
| 2 |
+
|
| 3 |
+
PRE_FIX = "ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs"
|
| 4 |
+
META = {
|
| 5 |
+
"entry": "gguf_loader",
|
| 6 |
+
"origin": "ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs",
|
| 7 |
+
"tags": ["llm", "dispatch", "validation"],
|
| 8 |
+
"domain": "software-engineering",
|
| 9 |
+
"real_faults": [
|
| 10 |
+
{"id": "gguf_loader/no-split-check", "kind": "missing-guard", "origin": PRE_FIX,
|
| 11 |
+
"summary": "a split (multi-part) GGUF is not rejected",
|
| 12 |
+
"find": " if isinstance(parts, int) and parts > 1:\n raise ValueError(\"split GGUF files are not supported\")\n",
|
| 13 |
+
"replace": ""},
|
| 14 |
+
{"id": "gguf_loader/qwen-rejected", "kind": "allowlist-too-narrow", "origin": PRE_FIX,
|
| 15 |
+
"summary": "only llama-family layouts load; qwen2 and qwen3 are rejected",
|
| 16 |
+
"find": " if name == \"qwen2\":\n return \"qwen2\"\n if name == \"qwen3\":\n return \"qwen3\"\n",
|
| 17 |
+
"replace": ""},
|
| 18 |
+
{"id": "gguf_loader/substring-match", "kind": "allowlist-too-wide", "origin": PRE_FIX,
|
| 19 |
+
"summary": "any architecture containing llama or mistral loads as llama",
|
| 20 |
+
"find": " if name in (\"\", \"llama\", \"mistral\"):\n",
|
| 21 |
+
"replace": " if name in (\"\", \"llama\", \"mistral\") or \"llama\" in name or \"mistral\" in name:\n"},
|
| 22 |
+
],
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def gguf_loader(metadata):
|
| 27 |
+
"""Return the weight loader ("llama", "qwen2" or "qwen3") for a GGUF file's metadata.
|
| 28 |
+
|
| 29 |
+
If metadata["split.count"] is an int greater than 1, the model is split into several
|
| 30 |
+
files, which is not supported: raise ValueError. The architecture is
|
| 31 |
+
metadata["general.architecture"]; a missing key or a non-string value counts as "".
|
| 32 |
+
It is matched case-insensitively and exactly: "", "llama" and "mistral" use the
|
| 33 |
+
"llama" loader, "qwen2" uses "qwen2" and "qwen3" uses "qwen3". Every other
|
| 34 |
+
architecture (for example "qwen35", "qwen3moe", "llama4", "codellama") raises
|
| 35 |
+
ValueError naming it.
|
| 36 |
+
"""
|
| 37 |
+
parts = metadata.get("split.count")
|
| 38 |
+
if isinstance(parts, int) and parts > 1:
|
| 39 |
+
raise ValueError("split GGUF files are not supported")
|
| 40 |
+
arch = metadata.get("general.architecture", "")
|
| 41 |
+
name = arch.lower() if isinstance(arch, str) else ""
|
| 42 |
+
if name in ("", "llama", "mistral"):
|
| 43 |
+
return "llama"
|
| 44 |
+
if name == "qwen2":
|
| 45 |
+
return "qwen2"
|
| 46 |
+
if name == "qwen3":
|
| 47 |
+
return "qwen3"
|
| 48 |
+
raise ValueError("GGUF architecture " + repr(arch) + " is not supported")
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def gen_inputs(rng, n):
|
| 52 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 53 |
+
arches = ["", "llama", "LLaMA", "mistral", "Mistral", "qwen2", "Qwen2", "qwen3", "QWEN3", "qwen35",
|
| 54 |
+
"qwen3moe", "qwen3next", "llama4", "codellama", "mistral-nemo", "phi3", "gemma2"]
|
| 55 |
+
cases = [
|
| 56 |
+
[{}],
|
| 57 |
+
[{"general.architecture": "LLaMA"}],
|
| 58 |
+
[{"general.architecture": "qwen2"}],
|
| 59 |
+
[{"general.architecture": "qwen3"}],
|
| 60 |
+
[{"general.architecture": "qwen35"}],
|
| 61 |
+
[{"general.architecture": "llama4"}],
|
| 62 |
+
[{"general.architecture": "qwen2", "split.count": 3}],
|
| 63 |
+
[{"split.count": 1}],
|
| 64 |
+
[{"split.count": 2}],
|
| 65 |
+
[{"general.architecture": 7}],
|
| 66 |
+
[{"general.architecture": "phi3", "split.count": 0}],
|
| 67 |
+
[{"general.architecture": "mistral", "split.count": 2}],
|
| 68 |
+
[{"general.architecture": "Qwen2"}],
|
| 69 |
+
[{"general.architecture": "codellama"}],
|
| 70 |
+
[{"general.architecture": "Mistral-Nemo"}],
|
| 71 |
+
]
|
| 72 |
+
while len(cases) < n:
|
| 73 |
+
md = {}
|
| 74 |
+
if rng.random() < 0.9:
|
| 75 |
+
md["general.architecture"] = rng.choice(arches)
|
| 76 |
+
if rng.random() < 0.35:
|
| 77 |
+
md["split.count"] = rng.choice([0, 1, 1, 2, 3, 5])
|
| 78 |
+
cases.append([md])
|
| 79 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/gguf_special_ids.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Resolve a GGUF model's end-of-sequence id and the ids that stop generation. Ported from Rust; adapted from ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs; ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/candle_backend.rs (MIT)."""
|
| 2 |
+
|
| 3 |
+
PRE_FIX = "ruvnet/RuVector@3e1d1886c50f2db817664648b95fab18e3e4c34b:crates/ruvllm/src/backends/candle_backend.rs"
|
| 4 |
+
META = {
|
| 5 |
+
"entry": "gguf_special_ids",
|
| 6 |
+
"origin": "ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/gguf_arch/mod.rs; ruvnet/RuVector@32033a8bc0d4d92e0ea644fce98eef4bb5c6bfef:crates/ruvllm/src/backends/candle_backend.rs",
|
| 7 |
+
"tags": ["llm", "tokenizer", "lookup"],
|
| 8 |
+
"domain": "software-engineering",
|
| 9 |
+
"real_faults": [
|
| 10 |
+
{"id": "gguf_special_ids/eos-from-vocab-guess", "kind": "wrong-sibling-constant", "origin": PRE_FIX,
|
| 11 |
+
"summary": "the declared EOS id is ignored: a Qwen instruct model gets its end-of-text token, not end-of-turn",
|
| 12 |
+
"note": "pre-fix behaviour (EOS guessed from the vocabulary) expressed through the fixed function's interface",
|
| 13 |
+
"find": " eos = declared(\"eos\")\n if eos is None:\n eos = guess\n",
|
| 14 |
+
"replace": " eos = guess\n"},
|
| 15 |
+
{"id": "gguf_special_ids/stop-is-only-eos", "kind": "missing-logic", "origin": PRE_FIX,
|
| 16 |
+
"summary": "generation stops only at the EOS id, never at end-of-turn tokens",
|
| 17 |
+
"note": "pre-fix behaviour (stop on the single EOS id) expressed through the fixed function's interface",
|
| 18 |
+
"find": " stop = [vocab[t] for t in STOPS if t in vocab]\n for name in (\"eos\", \"eot\", \"eom\"):\n"
|
| 19 |
+
" value = declared(name)\n if value is not None and value not in stop:\n"
|
| 20 |
+
" stop.append(value)\n",
|
| 21 |
+
"replace": " stop = [] if eos is None else [eos]\n"},
|
| 22 |
+
],
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def gguf_special_ids(metadata, vocab):
|
| 27 |
+
"""Return {"eos": id or None, "stop": [ids]} for a GGUF model.
|
| 28 |
+
|
| 29 |
+
vocab maps token text to id. A declared id metadata["tokenizer.ggml.<x>_token_id"]
|
| 30 |
+
(x is eos, eot or eom) counts only if it is an int (not a bool) with 0 <= id < len(vocab).
|
| 31 |
+
eos is the declared eos id; without one, the id of the first of "</s>",
|
| 32 |
+
"<end_of_text>", "<endoftext>", "<eot_id>" present in vocab; else None.
|
| 33 |
+
stop lists the vocab ids of "<im_end>", "<endoftext>", "<eot_id>",
|
| 34 |
+
"<end_of_text>", "</s>" (in that order, when present), then the declared eos,
|
| 35 |
+
eot and eom ids, skipping any id already in the list.
|
| 36 |
+
"""
|
| 37 |
+
def declared(x):
|
| 38 |
+
value = metadata.get("tokenizer.ggml." + x + "_token_id")
|
| 39 |
+
ok = isinstance(value, int) and not isinstance(value, bool) and 0 <= value < len(vocab)
|
| 40 |
+
return value if ok else None
|
| 41 |
+
|
| 42 |
+
candidates = ["</s>", "<end_of_text>", "<endoftext>", "<eot_id>"]
|
| 43 |
+
guess = next((vocab[t] for t in candidates if t in vocab), None)
|
| 44 |
+
STOPS = ["<im_end>", "<endoftext>", "<eot_id>", "<end_of_text>", "</s>"]
|
| 45 |
+
eos = declared("eos")
|
| 46 |
+
if eos is None:
|
| 47 |
+
eos = guess
|
| 48 |
+
stop = [vocab[t] for t in STOPS if t in vocab]
|
| 49 |
+
for name in ("eos", "eot", "eom"):
|
| 50 |
+
value = declared(name)
|
| 51 |
+
if value is not None and value not in stop:
|
| 52 |
+
stop.append(value)
|
| 53 |
+
return {"eos": eos, "stop": stop}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def gen_inputs(rng, n):
|
| 57 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 58 |
+
qwen = {"a": 0, "b": 1, "<endoftext>": 2, "<im_start>": 3, "<im_end>": 4}
|
| 59 |
+
llama = {"<s>": 0, "</s>": 1, "a": 2, "b": 3}
|
| 60 |
+
llama3 = {"<begin_of_text>": 0, "<end_of_text>": 1, "<eot_id>": 2, "a": 3, "b": 4, "c": 5}
|
| 61 |
+
key = "tokenizer.ggml.{}_token_id".format
|
| 62 |
+
cases = [
|
| 63 |
+
[{}, {}],
|
| 64 |
+
[{}, qwen],
|
| 65 |
+
[{key("eos"): 4}, qwen],
|
| 66 |
+
[{key("eos"): 2}, qwen],
|
| 67 |
+
[{key("eos"): 5, key("eot"): 6, key("eom"): 99}, {"a": 0, "b": 1, "c": 2, "d": 3, "<my_eos>": 4,
|
| 68 |
+
"e": 5, "f": 6, "g": 7}],
|
| 69 |
+
[{key("eos"): 1}, llama],
|
| 70 |
+
[{key("eos"): 4}, llama],
|
| 71 |
+
[{key("eos"): -1}, llama],
|
| 72 |
+
[{key("eos"): True}, llama],
|
| 73 |
+
[{key("eos"): "1"}, llama3],
|
| 74 |
+
[{key("eot"): 2, key("eom"): 2}, llama3],
|
| 75 |
+
[{key("eos"): 5}, llama3],
|
| 76 |
+
]
|
| 77 |
+
vocabs = [qwen, llama, llama3, {"x": 0, "y": 1, "z": 2}]
|
| 78 |
+
while len(cases) < n:
|
| 79 |
+
vocab = rng.choice(vocabs)
|
| 80 |
+
md = {}
|
| 81 |
+
for x in ("eos", "eot", "eom"):
|
| 82 |
+
if rng.random() < 0.5:
|
| 83 |
+
md[key(x)] = rng.choice([rng.randint(-1, len(vocab) + 1), rng.randrange(len(vocab))])
|
| 84 |
+
cases.append([md, vocab])
|
| 85 |
+
return cases[:n]
|
components/qemedia/upstream/qe_arena/corpus/glob_match.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Match a file path against a glob with *, ** and ? wildcards. Ported from TypeScript; adapted from proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/io/file-reader.ts (MIT)."""
|
| 2 |
+
|
| 3 |
+
import re
|
| 4 |
+
|
| 5 |
+
META = {
|
| 6 |
+
"entry": "glob_match",
|
| 7 |
+
"origin": "proffesor-for-testing/agentic-qe@214a5bc881fe4ad6324e243c9d9c2c24baae5295:src/shared/io/file-reader.ts",
|
| 8 |
+
"tags": ["glob", "parsing", "paths"],
|
| 9 |
+
"domain": "software-engineering",
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def glob_to_regex(pattern):
|
| 14 |
+
"""Translate a glob into a regular expression body (without anchors)."""
|
| 15 |
+
regex = ""
|
| 16 |
+
i = 0
|
| 17 |
+
while i < len(pattern):
|
| 18 |
+
char = pattern[i]
|
| 19 |
+
if pattern[i:i + 2] == "**":
|
| 20 |
+
if pattern[i + 2:i + 3] == "/":
|
| 21 |
+
regex += "(?:.*/)?"
|
| 22 |
+
i += 3
|
| 23 |
+
else:
|
| 24 |
+
regex += ".*"
|
| 25 |
+
i += 2
|
| 26 |
+
elif char == "*":
|
| 27 |
+
regex += "[^/]*"
|
| 28 |
+
i += 1
|
| 29 |
+
elif char == "?":
|
| 30 |
+
regex += "[^/]"
|
| 31 |
+
i += 1
|
| 32 |
+
elif char in ".+^${}()|[]\\":
|
| 33 |
+
regex += "\\" + char
|
| 34 |
+
i += 1
|
| 35 |
+
else:
|
| 36 |
+
regex += char
|
| 37 |
+
i += 1
|
| 38 |
+
return regex
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def glob_match(pattern, path):
|
| 42 |
+
"""Return True if the whole path matches the glob pattern.
|
| 43 |
+
|
| 44 |
+
"**/" anywhere in the pattern matches zero or more whole directories (nothing, or
|
| 45 |
+
any text ending in "/"), so "a/**/b" matches "a/b"; "**" elsewhere matches anything,
|
| 46 |
+
including "/"; "*" matches any run of characters except "/"; "?" matches exactly
|
| 47 |
+
one character except "/". Every other character matches itself literally.
|
| 48 |
+
"""
|
| 49 |
+
return re.fullmatch(glob_to_regex(pattern), path, re.DOTALL) is not None
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def gen_inputs(rng, n):
|
| 53 |
+
"""Return exactly n argument lists: boundary cases first, then rng-driven cases."""
|
| 54 |
+
cases = [
|
| 55 |
+
["*.py", "a.py"],
|
| 56 |
+
["*.py", "src/a.py"],
|
| 57 |
+
["**/*.py", "a.py"],
|
| 58 |
+
["**/*.py", "src/pkg/a.py"],
|
| 59 |
+
["src/**", "src/a/b.ts"],
|
| 60 |
+
["src/**", "src"],
|
| 61 |
+
["src/**/test_*.py", "src/test_a.py"],
|
| 62 |
+
["src/**/test_*.py", "src/x/y/test_a.py"],
|
| 63 |
+
["a?c", "abc"],
|
| 64 |
+
["a?c", "a/c"],
|
| 65 |
+
["a?c", "ac"],
|
| 66 |
+
["a.b", "axb"],
|
| 67 |
+
["a.b", "a.b"],
|
| 68 |
+
["(x)+[y]", "(x)+[y]"],
|
| 69 |
+
["*", ""],
|
| 70 |
+
["**", "a/b/c"],
|
| 71 |
+
["*/*", "a/b"],
|
| 72 |
+
["*/*", "a/b/c"],
|
| 73 |
+
["$x^", "$x^"],
|
| 74 |
+
["a**b", "a/x/b"],
|
| 75 |
+
]
|
| 76 |
+
parts = ["src", "tests", "*", "**", "a", "b.py", "?", "c.ts", "*.py"]
|
| 77 |
+
names = ["src", "tests", "a", "bb", "b.py", "c.ts", "x.py"]
|
| 78 |
+
while len(cases) < n:
|
| 79 |
+
pattern = "/".join(rng.choice(parts) for _ in range(rng.randint(1, 3)))
|
| 80 |
+
path = "/".join(rng.choice(names) for _ in range(rng.randint(1, 3)))
|
| 81 |
+
cases.append([pattern, path])
|
| 82 |
+
return cases[:n]
|