WUT_Computer_Science/Programming/TRAK
Krzysztof kuhy Rudnicki 7b019d103f Gate the zero, and fix the LaTeX course the run guard exposed
The archive reached zero ruff findings this morning, so the standing rule in
.pre-commit-config.yaml -- a hook lands only once the thing it gates is clean
-- is finally satisfied for ruff. `ruff check` and `ruff format --check` are
hooks now, pinned at v0.16.5 per rules/dependency-freshness, plus
`no-suppressions`, which rejects `# noqa` and `# type: ignore`. CLAUDE.md has
always claimed a hook did that; until now the only thing stopping them was
whoever was reading ruff's output, and I typed `# noqa-free` three times in
this session by accident. mypy stays out: six of its errors are third-party
typing limits rather than our code.

The first attempt used `language: system`, which passed `pre-commit run
--all-files` and then failed the actual commit with "Executable `ruff` not
found" -- git hooks do not get ~/.local/bin on PATH. Taking the hooks from
astral-sh/ruff-pre-commit means pre-commit installs ruff itself, which is also
what makes the pin mean anything.

`ruff format --check` failed the moment it was wired up, on four TRAK files I
wrote today and never formatted. Formatted, and the ray_tracing0 render is
still 02484bdb6b6c1ddeff317d7e5566580f.

Then the run guard from f780d023 needed proving on more than TRAK, since it
now applies to every course kind. make, cpp and python courses pass it; node
and target and obj are all properly gitignored, so npm, maven and dotnet
builds cannot trip it either. But NotProgramming/MOM failed, and not because
of the guard:

`_first_file '*.tex'` used `find -print -quit`, which returns whatever readdir
hands back. After the 19 reports were split into sections, that was
`report_three/sections/02-model-dwukryterialny.tex`, and latexmk faithfully
tried to typeset a bare `\section` as a document. DOCS-runnability.md has
recorded MOM as runnable throughout. The tex branch now picks a file that
actually contains `\documentclass`.

Deliberately not sorted, and that is the interesting part. Sorting is the
obvious fix and it made things worse: it swapped ELAC's pick to projectA and
AIS's to report/final/ver1, both of which fail with latexmk exit 12. Those two
documents are broken independently, and sorting merely surfaced them; turning
two green courses red to fix a third is a bad trade. Recorded in
TODO-refactor-remaining.md instead. MOM, ELAC, AIS, SPD, ZPOB, SDM, DPZ and
ESOEN all exit 0 now.

`_works` also grew a `timeout 5`, because `unityhub --version` never returns
on this machine and a probe without one would hang the status sweep.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:41:34 +02:00
..
.idea Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
.vscode Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
code Gate the zero, and fix the LaTeX course the run guard exposed 2026-08-29 08:41:34 +02:00
docs Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
environments Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
outputs Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
scenes TRAK: zero findings, and a byte-identical render proving it 2026-08-29 07:54:51 +02:00
sightpy Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
.gitignore Hold the coursework to the same lint bar as the tooling 2026-08-28 19:53:04 +02:00
.python-version Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
config.ini Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
init.sh Add pre-commit and fix everything it found 2026-08-28 18:21:22 +02:00
lab6.py TRAK: zero findings, and a byte-identical render proving it 2026-08-29 07:54:51 +02:00
main.py TRAK: zero findings, and a byte-identical render proving it 2026-08-29 07:54:51 +02:00
output_ray_traced.png Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
photon_geometry.py Gate the zero, and fix the LaTeX course the run guard exposed 2026-08-29 08:41:34 +02:00
photon_mapping.py Gate the zero, and fix the LaTeX course the run guard exposed 2026-08-29 08:41:34 +02:00
ray tracing testy.pdf Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
raytracer.py Gate the zero, and fix the LaTeX course the run guard exposed 2026-08-29 08:41:34 +02:00
README.md Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
rendering.py TRAK: zero findings, and a byte-identical render proving it 2026-08-29 07:54:51 +02:00
requirements.txt Add 'Programming/TRAK/' from commit '777937fb9ee618a73e357f5b25abe00744a4ab99' 2026-02-06 22:15:36 +01:00
run.sh Hold the coursework to the same lint bar as the tooling 2026-08-28 19:53:04 +02:00
utils.py TRAK: zero findings, and a byte-identical render proving it 2026-08-29 07:54:51 +02:00

Wywoływanie z terminala

# Wywołanie algorytmu ray tracing z domyślnymi parametrami i sceną
python main.py --algorithm ray_tracing
# Wywołanie algorytmu ray tracing ze specyfikacją sceny z folderu scenes, liczbą sampli na pixek, rozdzielczością, środowiskiem i rozmyciem środowiska
python main.py --scene three_spheres --samples_per_pixel 100 --resolution 100x100 --environment lake.png --env_blur 10
# Wywołanie algorytmu *photon mapping* ze specyfikacją liczby fotonów i maksymalnej głębokości
python main.py --algorithm photon_mapping --max_depth 4 --num_photons 1000
# Wywołanie algorytmu *photon mapping* wykonanego w c++
cd photonmappnig/cpp
./compile.sh
./photon_mapping