Commit Graph

1474 Commits

Author SHA1 Message Date
Bartosz Taudul
2bc3b87a2d Fix TracyLlm initialization when LLM is disabled. 2026-02-19 18:33:45 +01:00
Bartosz Taudul
574e0d17ec Reorder symbol statistics checkboxes and disable kernel when external is off.
External symbols checkbox now appears before kernel symbols, and kernel
is disabled when external is not selected since kernel symbols are a
subset of external symbols.
2026-02-19 00:51:04 +01:00
Bartosz Taudul
cea95bdede Do not show external symbols, frame by default. 2026-02-19 00:45:44 +01:00
Bartosz Taudul
2ecb45d8c0 Font data must be always available. 2026-02-17 21:48:43 +01:00
Naveen Regulla
9879a31fc5 Add Windows on ARM64 with MSVC support for Tracy Profiler
Introduce Windows ARM64(native) support across ToyPathTracer,
profiler, and server code paths when building with MSVC(_M_ARM64).

Key changes:
- MathSimd.h/Maths.h:
   - Fix NEON movemask constants for MSVC/ARM64 by loading from a uint32_t[]
    via vld1q_u32() and using vdupq_n_u32() for highbit.
- enkiTS/TaskScheduler.cpp:
   - Provide Pause() implementation on _M_ARM64 using __yield().
- profiler/winmain.cpp:
   -  AVX feature checks to x86/x64 only and skip on ARM64.
- server/TracyPopcnt.hpp:
   - Implement TracyCountBits using ARM NEON intrinsics.
   - Implement TracyLzcnt using _BitScanReverse64().
2026-02-17 16:42:50 +05:30
Bartosz Taudul
75320a3353 Fix race condition when regenerating LLM reply.
The chat regenerate/trash button handling had a monolithic lock that
blocked the worker thread during token counting. The token counting
is performed by calling TracyLlmApi::Tokenize(), which issues a
blocking HTTP POST request to the LLM API - on the UI thread.

To avoid blocking both the worker and freezing the UI during HTTP
calls, the lock was split into m_jobsLock and m_chatLock. However,
this introduced a race condition.

For the assistant role (regenerate message action), the code:
1. Stops the current job and queues a new one (under m_jobsLock)
2. Releases the lock
3. Performs token counting via HTTP calls (no lock held)
4. Re-acquires m_jobsLock and stops m_currentJob again

Between steps 2 and 4, the worker thread can complete the old job
and pick up the newly queued job. The stop at step 4 then incorrectly
stops the new regenerate job instead of the old one.

Under the original monolithic lock, the worker couldn't access
m_currentJob until after step 4, so the stop always applied to the
correct job. After the split, the second stop became harmful for
the assistant case.

The fix makes the second stop conditional on user role only (thrash
action), since that's the case where no new job is queued and we
genuinely need to stop any running generation before the user edits
their message.
2026-02-17 00:04:53 +01:00
Bartosz Taudul
c1556a0a73 Merge pull request #1281 from slomp/slomp/fix-zoom-hang
Fix UI hangs due to mouse-wheel zooming
2026-02-12 18:55:35 +01:00
Bartosz Taudul
02a229b12f Merge pull request #1282 from DaniPopes/dani/fix-wasm-paste
fix: handle paste events in wasm backend
2026-02-12 13:24:38 +01:00
DaniPopes
7d27fe6ff9 fix: handle paste events in wasm backend
Listen for browser paste events and directly inject clipboard text via
AddInputCharactersUTF8. Also suppress character input when Ctrl/Meta is
held to prevent 'v' from being typed on Cmd+V.
2026-02-11 23:42:45 -05:00
Marcos Slomp
f61fa7b0e4 ensure that t0 <= t1 to prevent time-point crossover (leading to UI hangs) 2026-02-11 14:45:38 -08:00
DaniPopes
12a964d3be fix: UI zoom scale not applying on macOS
On macOS with Retina displays, dpiScale is 2.0 but gets overridden to
userScale alone under __APPLE__. The early-return check compared
prevScale against the pre-override value (dpiScale * userScale), which
for 50% zoom evaluates to 2.0 * 0.5 = 1.0, matching the previous
prevScale of 1.0 and causing an early return before the scale change
could take effect. Moving the __APPLE__ override before the early-return
check ensures the comparison uses the actual effective scale.
2026-02-10 16:33:02 -05:00
DaniPopes
a23e910d5f Implement clipboard support for WASM backend
The Emscripten backend was missing Platform_SetClipboardTextFn/GetClipboardTextFn,
so ImGui::SetClipboardText was a no-op in the browser.
Hook navigator.clipboard.writeText for writes and keep a local copy for reads.
2026-02-07 03:36:25 +01:00
Bartosz Taudul
c93c9bce6f Improve how tool calls are presented to user.
1. Tool replies are now integrated with tool calls.
2. Tool calls now have textual descriptions.
2026-02-06 18:37:01 +01:00
Bartosz Taudul
0b02b097a9 Pass current and end chat iterators to TracyLlmChat::Turn(). 2026-02-06 17:33:59 +01:00
Bartosz Taudul
9d78cca5ff Redo LLM locks. 2026-02-06 02:28:14 +01:00
Bartosz Taudul
a31ab53d26 Check if the response contains finish_reason before getting its value. 2026-02-05 18:31:05 +01:00
Bartosz Taudul
66cc77bd5f Don't access ghost zones before they are ready. 2026-02-05 00:42:42 +01:00
DaniPopes
5c5af7c1e5 Sort threads by ID after name
The "sort" button for threads uses an unstable sort, so threads with
the same name will shuffle around without ever stabilizing.

Use `id` to sort after comparing the name.
2026-02-04 06:51:43 +01:00
Bartosz Taudul
ca5ef812a3 Apple is also busted. 2026-02-01 20:39:53 +01:00
Bartosz Taudul
a9ea7ec1c9 Workaround libc++ issues. 2026-02-01 18:57:49 +01:00
Bartosz Taudul
8f0c83dbf9 Fix View ptr assignment. 2026-02-01 18:55:53 +01:00
Bartosz Taudul
2b201e6f59 RetrieveThread() uses a cache that cannot be shared between threads.
Note: IsThreadFiber() uses the same functionality, but is only called from
the main thread.
2026-02-01 18:01:39 +01:00
Bartosz Taudul
c86549a3bb View is accessed concurrently. 2026-02-01 17:29:34 +01:00
Bartosz Taudul
aba3ae2869 View's m_wasActive is used concurrently. 2026-02-01 16:55:46 +01:00
Bartosz Taudul
d1e831f69d Proper way of setting sanitizer parameters. 2026-02-01 16:44:15 +01:00
Bartosz Taudul
1d2b6cca24 Pack source code attachments.
Example source file, glm-4.7-flash:

5519 -> 4699 tokens (85%)
2026-02-01 16:37:42 +01:00
Bartosz Taudul
d71a38632c Nice formatting for host info. 2026-02-01 14:53:22 +01:00
Bartosz Taudul
d4d9339d95 Provide name of the profiled program to LLM. 2026-02-01 14:53:22 +01:00
Bartosz Taudul
0ad8767903 Explicitly mark non-inline frames as non-inline in LLM attachment. 2026-02-01 14:53:19 +01:00
Bartosz Taudul
bc122d5c3d Do not call Glue() in PrintTextExt(). 2026-02-01 02:35:26 +01:00
Bartosz Taudul
b60ab86fa5 Extend link support to code sections, separators, etc. 2026-02-01 02:14:42 +01:00
Bartosz Taudul
32fae40c4e Extract link hover functionality to a separate function. 2026-02-01 02:05:08 +01:00
Bartosz Taudul
324ecdcb99 Change source code separator in LLM attachments. 2026-02-01 01:48:55 +01:00
Bartosz Taudul
c886c8fa00 Remove remains of vision in tool replies. 2026-01-31 19:21:24 +01:00
Bartosz Taudul
925732914a Draw source code preview in source file link tooltip. 2026-01-31 19:17:44 +01:00
Bartosz Taudul
d1ae380cc2 Make View::DrawSourceTooltip() public. 2026-01-31 19:17:07 +01:00
Bartosz Taudul
9d33668c9d Proper check for source file validity. 2026-01-31 18:54:43 +01:00
Bartosz Taudul
903b6b198f Retrieve source file string index and line number only once. 2026-01-31 18:42:07 +01:00
Bartosz Taudul
30ea4ed341 Print a nice tooltip for source links. 2026-01-31 18:35:37 +01:00
Bartosz Taudul
5b7a6bf447 Add instructions for providing source file links. 2026-01-31 18:03:31 +01:00
Bartosz Taudul
4fe8d16a20 Add support for source file links in markdown renderer. 2026-01-31 18:03:11 +01:00
Bartosz Taudul
7cc7e484b9 Make source search results more compact. 2026-01-30 22:55:55 +01:00
Bartosz Taudul
cfcc8af5c3 Remove indentation from tool replies. 2026-01-30 22:37:50 +01:00
Bartosz Taudul
3ce2905582 Default value does not need to be repeated. 2026-01-30 22:36:16 +01:00
Bartosz Taudul
67b75ac7fb Restore attachment indentation when viewing contents in UI. 2026-01-30 22:31:25 +01:00
Bartosz Taudul
99b70f7a6e Remove indentation from LLM attachments.
This has quite large effect on number of tokens. Example assembly attachment:

glm-4.7-flash: 7452 -> 5799 (77%)
gpt-oss-20b:   6896 -> 5245 (76%)
2026-01-30 22:27:55 +01:00
Bartosz Taudul
50eae09cda Source location may be missing a line number.
The valid check here is for the source file index being set (active).
The line number might be zero.

This fixes the "black" unknown source location in assembly listing.
2026-01-30 21:44:24 +01:00
Bartosz Taudul
b9a4bf4f7b Use the intended weighting order in ManageContext(). 2026-01-30 20:58:56 +01:00
Bartosz Taudul
d6e62b3c1f Spell out (long!) source file names in assembly attachments only once. 2026-01-30 01:38:20 +01:00
Bartosz Taudul
e017f504c6 Split source_file parameter context into context and context_back. 2026-01-30 01:07:15 +01:00