Skip to content

Add synthetic tool wear environment#16

Open
GHX5T-SOL wants to merge 2 commits into
programmablemanufacturing:mainfrom
GHX5T-SOL:feat/15-tool-wear-environment
Open

Add synthetic tool wear environment#16
GHX5T-SOL wants to merge 2 commits into
programmablemanufacturing:mainfrom
GHX5T-SOL:feat/15-tool-wear-environment

Conversation

@GHX5T-SOL
Copy link
Copy Markdown

@GHX5T-SOL GHX5T-SOL commented May 18, 2026

Summary

  • Add ToolWearEnvironment, a simple synthetic machine-degradation environment with bounded tool wear, temperature, surface quality, and defect-risk state.
  • Export the environment from imwm.envs and add a small examples/run_tool_wear.py smoke example.
  • Add focused tests for reset/step behavior, bounded state output, monotonic wear, episode completion, and seed reproducibility.
  • Reformat the touched Python files with standard Black line breaks and update the README to call out the tool-wear scenario separately from the existing process-window environment.

Related to #19.

Validation

  • uv venv .venv --python 3.12
  • uv pip install -e '.[dev]' 'numpy<2'
  • PATH=.venv/bin:$PATH python examples/run_tool_wear.py -> ran the 3-step smoke example and reached done=True
  • PATH=.venv/bin:$PATH python -m pytest -q -> 5 passed in 1.17s
  • git diff --check
  • git diff -- src/imwm/envs/tool_wear.py tests/test_tool_wear_env.py README.md | gitleaks stdin --no-banner --redact --exit-code 1

Notes

This is aimed at Issue #19's machine-degradation option. It is distinct from the existing process-window toy environment because the state evolves around accumulated tool wear, coolant/temperature trade-offs, surface quality, and defect risk over repeated steps.

The local shell on this machine does not expose a bare python executable until the venv is on PATH, so the requested python examples/run_tool_wear.py and python -m pytest -q checks were run with .venv/bin first on PATH.

The local validation environment needed numpy<2 because the resolved Torch wheel on this machine had previously been incompatible with NumPy 2.x. I did not change dependency constraints in this PR.

This is an educational synthetic toy environment, not a physical-accuracy model.

@programmablemanufacturing
Copy link
Copy Markdown
Owner

Thanks for the contribution — I appreciate the work on the synthetic tool-wear environment.

One clarification: I have since re-scoped Issue #15, so this PR no longer matches the current scope of #15. The original “add one synthetic manufacturing environment” task is now tracked under Issue #19, and that issue has already been completed.

So this PR should be treated as related to #19 rather than #15.

If you would still like to continue with this PR, could you please do two things?

  1. Update the PR description so it references Issue Good first issue: Add one new synthetic manufacturing environment #19 instead of Issue Good first issue: Add baseline random/grid planner comparison #15.
  2. Make sure the contribution is clearly distinct from the environment already added for Good first issue: Add one new synthetic manufacturing environment #19, or explain how this tool-wear environment adds a different manufacturing scenario.

Also, before I can review for merge, please reformat the Python files with standard line breaks and indentation. Right now the raw files appear to have many statements collapsed into very few lines, so the code may not run correctly.

Could you also confirm that the following commands pass from the industrial-world-model directory?

python examples/run_tool_wear.py
python -m pytest -q

Thanks again — I’m happy to review once the PR is aligned with the correct issue and the formatting is fixed.

@GHX5T-SOL
Copy link
Copy Markdown
Author

Thanks for the clarification. I updated the PR body to reference #19 instead of #15 and added a short README note that this is the machine-degradation/tool-wear scenario rather than another process-window environment.

I also reformatted the touched Python files with standard Black line breaks and pushed 129d322.

Validation from benchmarks/toy-process-window/industrial-world-model:

  • PATH=.venv/bin:$PATH python examples/run_tool_wear.py -> 3-step smoke run completed and reached done=True
  • PATH=.venv/bin:$PATH python -m pytest -q -> 5 passed in 1.17s
  • git diff --check
  • changed-diff gitleaks stdin --no-banner --redact --exit-code 1

The local shell here only has python after the venv is placed first on PATH, so I ran the requested python ... commands that way.

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.

2 participants