Skip to content

Add comprehensive mod conflict and mode-specific validation#144

Open
cmyui wants to merge 1 commit intomasterfrom
feat/comprehensive-mod-validation
Open

Add comprehensive mod conflict and mode-specific validation#144
cmyui wants to merge 1 commit intomasterfrom
feat/comprehensive-mod-validation

Conversation

@cmyui
Copy link
Member

@cmyui cmyui commented Jan 19, 2026

Summary

This PR implements comprehensive validation for mod combinations and mode-specific mods to prevent invalid score submissions.

Changes

Mod Conflict Validation

Added detection for all invalid mod combinations:

  • NF/RX/AP + SD - Can't both prevent and require fail
  • NF/RX/AP + PF - Can't both allow failure and require perfection
  • RX/AP + NF - NF is redundant with RX/AP
  • PF + SD - Redundant/conflicting fail conditions
  • SO + RX/AP - SpunOut conflicts with auto-aim mods
  • Existing checks: DT+HT, EZ+HR, RX+AP, HD+FI, multiple keymods

Mode-Specific Validation

Added incompatible_with_mode() method to check mode restrictions:

  • SpunOut (SO) and Autopilot (AP) - Standard mode only
  • FadeIn (FI), Random (RN), Key mods - Mania mode only

Score Submission

Updated score submission endpoint to validate both:

  1. Mod conflicts via existing .conflict check
  2. Mode compatibility via new .incompatible_with_mode() check

Users will be auto-restricted if they attempt to submit invalid combinations.

Context

During achievement backfill analysis, we discovered 1,544 relax scores and 36 autopilot scores with the NF (NoFail) mod bit set, which is semantically meaningless since RX/AP already prevent failure. This validation prevents such submissions in the future.

Testing

All validation logic was tested with 37 test cases covering:

  • 9 fail-prevention conflict scenarios
  • 2 SpunOut conflict scenarios
  • Existing conflict checks (DT+HT, EZ+HR, etc.)
  • Mode-specific restrictions (SO/AP/FI/keymods)
  • Valid combinations (no false positives)

All tests passed ✓

- Add all invalid mod combinations to conflict check:
  - NF/RX/AP + SD (fail prevention + sudden death)
  - NF/RX/AP + PF (fail prevention + perfect)
  - RX/AP + NF (redundant fail prevention)
  - PF + SD (redundant/conflicting fail conditions)
  - SO + RX/AP (spunout + auto-aim conflicts)
  - Existing: DT+HT, EZ+HR, RX+AP, HD+FI, multiple keymods

- Add mode-specific mod validation:
  - SpunOut (SO) and Autopilot (AP): Standard mode only
  - FadeIn (FI), Random (RN), Key mods: Mania mode only

- Update score submission to check mode compatibility
- Restrict users who submit invalid mod combinations

This prevents future submissions like NF+RX that were found in historical
data (1,544 relax scores with NF bit, 36 autopilot scores with NF bit).
@cmyui cmyui requested a review from infernalfire72 as a code owner January 19, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant