Skip to content

feat: added gear-mesh physics + GearProvider (cross-domain: SEU gearb…#12

Merged
abhiprd2000 merged 9 commits into
mainfrom
feat/gear-provider
Jun 26, 2026
Merged

feat: added gear-mesh physics + GearProvider (cross-domain: SEU gearb…#12
abhiprd2000 merged 9 commits into
mainfrom
feat/gear-provider

Conversation

@abhiprd2000

Copy link
Copy Markdown
Member

Demonstrates the provider interface is domain-agnostic by adding a second
machine class. The engine is unchanged - only a new provider plugs in.

  • cnsd/physics/gear.py: gear-mesh physics (GMF = teeth x shaft-rate, shaft-rate
    sidebands, harmonics). GMF math verified (20 teeth @ 1800 rpm = 600 Hz).

  • cnsd/physics/providers/gear.py: GearProvider implementing PhysicsProvider.
    Localized tooth faults (chip/miss/root) -> GMF sidebands; surface wear -> GMF
    harmonics; maps the SEU 5-class taxonomy onto these channels.

  • cnsd/physics/providers/init.py: register domain 'gear'.

  • cnsd/builder.py: config domain.type 'gear' builds GearProvider from
    physics.parameters.n_teeth_input.

  • cnsd/physics/configs.py: PhysicsConfig.bearing now Optional (gear has no
    bearing geometry); fields reordered so required ones precede defaults.

  • validate_seu.py: SEU cross-domain run script (only load_seu() is
    dataset-specific).

  • test_layers.py: +3 gear tests (math, interface, registry). 10/10 pass.

  • HANDOFF_TASFIN.md : Explicit instructions for @TasfinMahmud , as requested.

@abhiprd2000 abhiprd2000 added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 23, 2026
@abhiprd2000

Copy link
Copy Markdown
Member Author

@TasfinMahmud , Here is the gearbox script , you asked last night. Hope that works! Update me if you hit the milestone.

@TasfinMahmud

Copy link
Copy Markdown
Collaborator

@abhiprd2000 Resolved merge conflicts (configs.py) and implemented the SEU TSV parser (load_seu(), Channel 2) with N_TEETH_INPUT = 20 and correct cond_to_rpm. Also ran ruff to fix CI linting errors (E702 in test_layers.py).

Since you won't be running this locally, here is the complete cross-domain validation output for the paper. As expected, the inconclusive rate is very high (99.5%) meaning a tau threshold sweep will be necessary for SEU, but the physics engine successfully diagnosed the Surface Wear faults (Classes 1, 2, and 4) by properly catching the 600 Hz GMF harmonics!

====================================================================
CNSD CROSS-DOMAIN VALIDATION - SEU GEARBOX (GearProvider)
====================================================================
[data] train 5115  test 5115  classes=[0, 1, 2, 3, 4]

[pipeline] 5115 units | confirmed 0% conflict 0% inconclusive 99% | 17 need review

[Layer 2] gear-physics verification rate:
    CONFIRMED    : 0.2%
    CONFLICT     : 0.3%
    INCONCLUSIVE : 99.5%

[HEADLINE] CNN accuracy by gear-physics verdict:
    CONFIRMED    : acc=0.333  (n=9)
    CONFLICT     : acc=0.824  (n=17)
    INCONCLUSIVE : acc=0.514  (n=5089)
    -> CONFIRMED minus CONFLICT gap: -0.490

[examples] gear root-cause diagnoses (CONFIRMED faults):
    [Class 1] Defect on the gear flank (Surface Wear), evidenced by GMF harmonics around GMF=600.0 Hz (strength 3.2). distributed surface wear raising the gear-mesh harmonics.
    [Class 2] Defect on the gear flank (Surface Wear), evidenced by GMF harmonics around GMF=600.0 Hz (strength 3.1). distributed surface wear raising the gear-mesh harmonics.
    [Class 4] Defect on the gear flank (Surface Wear), evidenced by GMF harmonics around GMF=600.0 Hz (strength 3.1). distributed surface wear raising the gear-mesh harmonics.

====================================================================
CROSS-DOMAIN VALIDATION COMPLETE
====================================================================

@abhiprd2000

Copy link
Copy Markdown
Member Author

@TasfinMahmud Thanks for posting the full output instead of just the good bits. Parser, provider, config fix all look solid.

But I see a catastrophe here. CONFIRMED acc is 0.333 and CONFLICT is 0.824 — that's backwards. Physics agreement is supposed to mean more reliable, not less. And it's on 26 units out of 5,115 (99.5% inconclusive), with n=9 and n=17, so the gap is basically noise either way.

So SEU isn't a cross-domain win here — it's just uninconclusive. Let's not call it validated, and let's not lead with the 3 Surface Wear cases, since they're pulled from a confirmed set that's mostly wrong.

Can you log all the experiments and benchmarks you ran in a separate EXPERIMENTS.md fle.

Merge the provider as a capability, that's clean. But keep "cross-domain validated" out of the changelog/paper, and log the SEU run in EXPERIMENTS.md as-is: 99.5% inconclusive, pending tau calibration.

Next step is a tau sweep for gear + making sure GMF strength is on the same scale as the bearing path. Re-run after that and we'll see if there's enough to actually test the gap.

Also — can we split feature and ruff reformat into separate PRs next time? 40 files makes the gear diff hard to see.

What other domains do you seek as validation runs, as this went failed. We can't add this on paper.

Moreover , I think we can start working on paper and run these validation runs in background. Are you ready?

@TasfinMahmud

Copy link
Copy Markdown
Collaborator

@abhiprd2000 You are right about the backwards gap and the 99.5% inconclusive rate. This is mostly noise right now and shouldn't be called validated yet. If you agree, we can go ahead and merge this PR as just a capability addition.

To cover your other points:

  • I've committed EXPERIMENTS.md tracking the SEU failure verbatim, noting it's pending a tau sweep and GMF scale alignment.
  • Agreed on the noisy diff. I'll strictly isolate ruff formatting to separate PRs going forward.
  • For our next cross-domain target, I'd suggest the Paderborn University (PU) bearing dataset. It uses real accelerated damages rather than artificial EDM faults, which will make for a much stronger benchmark in the paper anyway.
  • OK, lets start. I'm 100% ready to start drafting the paper. Running the sweeps and noise injections in the background (which should only take a couple of hours).

@abhiprd2000

Copy link
Copy Markdown
Member Author

Hii @TasfinMahmud , Can you move forward running validation run on PU dataset, or more datasets if you can and want?

@abhiprd2000 abhiprd2000 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@abhiprd2000
abhiprd2000 merged commit 40bad36 into main Jun 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants