Skip to content

[Build] Improve link checker#9

Merged
hughperkins merged 15 commits intomainfrom
hp/improve-link-checker
Jun 5, 2025
Merged

[Build] Improve link checker#9
hughperkins merged 15 commits intomainfrom
hp/improve-link-checker

Conversation

@hughperkins
Copy link
Copy Markdown
Collaborator

@hughperkins hughperkins commented Jun 3, 2025

Issue: #

Brief Summary

Existing link checker fails incorrectly on many anchors

  • tried digging into this on partial docs, building up doc bit by bit ,and it appears to be a bug: adding:

... breaks the link check

  • tried lychee, and that doesnt check nchors at all
  • when I asked deepseek for a recommenation, it simply wrote this script. it works. it's blazingly fast. It probalby needs unit tests.

updates:

  • added unit tests 🙌(yes, thank you deepseek :) )
  • fixed all the broken links that this tool points out 🙌(including al the ones the previous tool pointed out, but didn't help me to fix
    • this tool prints out all available anchors, so its super easy to fix, eg:


Screenshot 2025-06-03 at 4 49 36 PM

... pretty obvuios this should be #primtive-types

copilot:summary

Walkthrough

copilot:walkthrough

@hughperkins hughperkins changed the title Hp/improve link checker [Build] Improve link checker Jun 3, 2025
@hughperkins hughperkins marked this pull request as ready for review June 3, 2025 23:47
Comment thread docs/lang/articles/contribution/some_pic.png Outdated
Comment thread docs/lang/articles/reference/operator.md Outdated
Comment thread python/tools/markdown_link_check.py
Comment thread tests/python/test_tools_markdown_check.py
To avoid such implicit casting, you can manually cast your operands to
desired types, using `ti.cast`. You can control yourself the precision instead of using the default, see
[Default precisions](#default-precisions).
[Default precisions](global_settings.md#going-high-precision).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Going High Precision](...)

@hughperkins
Copy link
Copy Markdown
Collaborator Author

Thanks!

@hughperkins hughperkins merged commit 90f51db into main Jun 5, 2025
12 checks passed
@hughperkins hughperkins deleted the hp/improve-link-checker branch June 5, 2025 14:01
hughperkins added a commit that referenced this pull request Apr 26, 2026
Introduce the helper machinery that the per-class to_torch / to_numpy methods
will migrate to in subsequent commits. Existing public symbols (can_zerocopy,
dlpack_to_torch, invalidate_zerocopy_cache, current_arch_is_cpu) are preserved
as deprecated shims so the in-tree pre-rework callers continue to work; they
will be removed once every call site is migrated.

New surface:

- _ZerocopyCache: per-instance container with two independent slots (torch
  tensor + numpy ndarray), each filled lazily on first access via
  torch.utils.dlpack.from_dlpack and numpy.from_dlpack respectively. Numpy
  zero-copy now bypasses torch entirely (closes review #6).

- make_zerocopy_cache_if_supported(owner, ...): constructs a cache when
  zero-copy is supported and registers `owner` with `pyquadrants.cache_holders`
  so invalidation is wired automatically (closes review #18).

- get_zerocopy_torch / get_zerocopy_numpy: thin entry points that implement
  the always-zerocopy-then-clone semantic (closes review #15, #16, #21) and
  the Apple Metal double-sync (qd.sync() on read AND torch.mps.synchronize()
  after .clone()/.to(); closes review #1, #22, #23).

Also applies the small lints from the review:
- Module-level constant for the torch>2.9.1 MPS bytes_offset probe; drops the
  pointless lru_cache wrapper around a zero-arg helper (closes review #2).
- ASCII '...' instead of Unicode horizontal ellipsis '\u2026' in the docstring
  (closes review #3).
- Top-level imports for numpy and torch (try/except for the no-torch CI
  case); no per-call lazy imports in the new code path (closes review #7,
  #9). The deprecated shim still does what the existing per-class methods
  expect; the new helpers are torch-clean.

cache_holders is still empty until the next commits register Ndarray /
ScalarField / MatrixField; this commit alone is no-op behaviourally.
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.

3 participants