Repository navigation
Conversation
The three cards at the top of Personalisation never showed real data: - "Accept rate · 7d" and "Time saved · 7d" were hard-coded "0%" / "0 s". - "Words learned" shelled out to `xtype-corpus stats --json`, but nothing installs xtype-corpus and the script doesn't accept --json (argparse exits 2), so the count was always 0. It was also read only once at startup, and its bars were fixed placeholder values. CorpusStats now counts the corpus itself (corpus.txt plus rotated corpus.txt.N, skipping the engine's transient .tmp), follows the configured corpus_path, and recounts every 3 s only when a file's size or mtime changed. The 7 bars are real words-per-day for the last week, taken from corpus_timestamps.txt (one timestamp per corpus line). EngineProbe already polled metrics.json for latency; it now also exposes suggestions generated/accepted and chars accepted (parsed with QJsonDocument instead of a regex). Those counters live in the fcitx5 process and reset when it restarts, so the cards are relabelled "· this session" and drop the per-day bars. Time saved is an estimate: accepted characters at 40 WPM. Adds Catch2 tests for the corpus counting and metrics parsing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Wipe button in the "Reset profile" dialog only called
Qt.openUrlExternally("xtype-corpus://wipe") — a no-op placeholder — then
showed a "Corpus wiped" toast. Nothing was deleted, and the dialog
promised a backup that was never made.
CorpusStats::wipe() now deletes corpus.txt, its rotated copies, the
timestamp file, the engine's pruning scratch files and
style_profile.json, then recounts. The toast reports failures, the
dialog text says what really happens, and the dialog sizes to its text.
The running engine keeps its in-memory style profile until its next
5-minute refresh, which the dialog now states.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sidebar's CPU/RAM rows sat at 0% / 0.0 GB no matter what the model was doing. Two bugs: - RAM was read by looping on QFile::atEnd() over /proc/<pid>/status. procfs files report size 0, so QFile treats them as already at EOF and the loop never ran. RAM was never reported for any process. It now uses readAll(), as the CPU sampler already did. - Only the first process named "ollama" was sampled, i.e. `ollama serve`, which is nearly idle. Ollama loads the model in a child process (`llama-server`, or `ollama runner` on older versions). The probe now sums CPU and RSS over every ollama process and all of their descendants. CPU deltas are tracked per PID, so the runner coming and going on model load/unload doesn't cause spikes, and the percentage is now a share of the whole machine instead of one core clamped at 100 (the runner is multi-threaded). The sidebar also gets GPU and VRAM rows, and the Model page gets VRAM and GPU stat tiles, on machines with an NVIDIA GPU: - VRAM is the memory used by the engine's own processes (from `nvidia-smi --query-compute-apps`), with the bar scaled to that card's total. GPU is the utilisation of the card holding the model, or 0% when the model isn't on a GPU. - nvidia-smi runs asynchronously so the UI never blocks on it, and a hung call is killed after a few ticks. - The query is skipped while the NVIDIA GPU is runtime-suspended, so hybrid laptops aren't kept awake by the settings app. - Without an NVIDIA device or nvidia-smi the rows stay hidden. The four sidebar rows share one StatRow component with fixed caption and value widths, so the bars line up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ewerton
added a commit
to Ewerton/XType
that referenced
this pull request
Nov 16, 2026
Points readers at the upstream project, says which repo to clone for this version, and lists the fixes and features with links to their upstream pull requests (KS0Code#1-KS0Code#10). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CPU and RAM rows at the bottom of the sidebar stayed at
0%/0.0 GB, even while the model was generating. There were two bugs inEngineProbe:sampleRam()looped onwhile (!f.atEnd())over/proc/<pid>/status. procfs files report size 0, soQFiletreats them as already at EOF and the loop body never ran.commisollama, which isollama serve. That process uses about 40 MB and almost no CPU. Ollama loads the model in a child process,llama-server(orollama runneron older versions), which was never counted. With a 4B model loaded,serveused 40 MB andllama-serverused about 920 MB.Fix
CPU/RAM (
engine_probe.cpp):/proc/<pid>/statusis read withreadAll(), as the CPU sampler already did.ollamaprocess and all of its descendants (engineProcessTree()).GPU/VRAM, on machines with an NVIDIA GPU:
nvidia-smi --query-compute-apps), so other programs on the card aren't counted. The bar is scaled to that card's total.nvidia-smionly gives load per card, so other programs using the same card raise it too.nvidia-smiruns asynchronously (QProcess::finished), so the UI never blocks on it. A hung call is killed after about 6 s./sys/bus/pci/devices/*/power/runtime_status), so hybrid laptops aren't woken up by the settings app.nvidia-smi,Engine.gpuAvailableis false and the rows and tiles stay hidden.Sidebar layout (
XSidebar.qml): the four rows share oneStatRowcomponent with fixed caption and value widths, so the bars line up.Testing
tests/test_stats.cpp, all passing:engineProcessTree: finds the runner underollama, ignores an unrelatedllama-server, and returns nothing when Ollama isn't running.summarizeGpu: counts only the engine's VRAM and its card's load, reports 0% when the model is off the GPU, and tolerates[N/A]fields and empty output.qwen3:4b-instruct-2507-q4_K_Mfully offloaded, sampled every 1.5 s through one generation:0%/0.0 GBthroughout. I also checked the sidebar in the running app (CPU 29%, RAM 1.0 GB while generating), before the GPU rows were added.🤖 Generated with Claude Code