Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'test' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    UnicodeDecodeError
Message:      'utf-8' codec can't decode byte 0xa1 in position 18923: invalid start byte
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 244, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 4408, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2679, in _head
                  return next(iter(self.iter(batch_size=n)))
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2861, in iter
                  for key, pa_table in ex_iterable.iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2395, in _iter_arrow
                  yield from self.ex_iterable._iter_arrow()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/csv/csv.py", line 196, in _generate_tables
                  csv_file_reader = pd.read_csv(file, iterator=True, dtype=dtype, **self.config.pd_read_csv_kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/streaming.py", line 73, in wrapper
                  return function(*args, download_config=download_config, **kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/utils/file_utils.py", line 1279, in xpandas_read_csv
                  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)
                         ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1026, in read_csv
                  return _read(filepath_or_buffer, kwds)
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 620, in _read
                  parser = TextFileReader(filepath_or_buffer, **kwds)
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1620, in __init__
                  self._engine = self._make_engine(f, self.engine)
                                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1898, in _make_engine
                  return mapping[engine](f, **self.options)
                         ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 93, in __init__
                  self._reader = parsers.TextReader(src, **kwds)
                                 ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "pandas/_libs/parsers.pyx", line 574, in pandas._libs.parsers.TextReader.__cinit__
                File "pandas/_libs/parsers.pyx", line 663, in pandas._libs.parsers.TextReader._get_header
                File "pandas/_libs/parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows
                File "pandas/_libs/parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status
                File "pandas/_libs/parsers.pyx", line 2053, in pandas._libs.parsers.raise_parser_error
                File "<frozen codecs>", line 325, in decode
              UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 18923: invalid start byte

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

MCU Resource Planning RAG+LLM System: Experiment Reproduction Guide

This repository reproduces Tables 1–4 and the case study of the paper. It explains the preparation steps (environment + LLM configuration), the commands that generate the table data, and the commands that generate the case-study data (allocation CSVs).

All offline commands in this guide were verified end-to-end on Windows (Python 3.12, PowerShell). Follow Sections 1.1–1.2 first — two Windows-specific settings are mandatory.


1. Preparation

1.1 Environment

Requires Python >= 3.10.

pip install -r requirements.txt

Interpreter check (Windows): make sure python resolves to the real Python, not a bundled interpreter shipped with other software (e.g. Inkscape's D:\Program Files\Inkscape\bin\python.exe). Verify with:

python -c "import sys; print(sys.executable)"

If it prints a non-Python path, use the py launcher instead (verified working): py scripts/run_ablation.py ..., or the full path to the real interpreter, e.g. C:\Users\<you>\AppData\Local\Programs\Python\Python312\python.exe. All python ... commands below work as-is once the correct interpreter is first on PATH.

Console encoding (Windows, verified mandatory): the historical CSV filenames contain a non-ASCII character (U+2011 non-breaking hyphen). On a GBK (Chinese-locale) console the scripts crash with UnicodeEncodeError while printing them. Always set UTF-8 mode before launching Python (it cannot be put into .env — it is read at interpreter startup):

$env:PYTHONUTF8 = "1"      # per-session; already prepended to every command below
setx PYTHONUTF8 1          # optional: make it permanent for future sessions

1.2 LLM configuration (Bailian / DashScope, OpenAI-compatible)

All API settings are read from environment variables or a .env file at the repository root (agent/config.py loads it automatically). Only online mode needs a key.

# Option A: set environment variables directly (PowerShell)
$env:DASHSCOPE_API_KEY = "sk-..."          # required for online mode
$env:LLM_MODEL  = "qwen-max"               # optional, default: qwen-max (qwen-plus / qwen-turbo also OK)
$env:EMBED_MODEL = "text-embedding-v3"     # optional, default: text-embedding-v3
# Option B: create a .env file at the repo root
DASHSCOPE_API_KEY=sk-...
DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_MODEL=qwen-max
EMBED_MODEL=text-embedding-v3
LLM_TEMPERATURE=0.1
RUN_MODE=online

Verify the API connectivity (no index will be built):

$env:PYTHONUTF8 = "1"
python scripts/quick_api_test.py

Note: --mode offline used throughout this guide never calls any external API. It uses deterministic heuristics, so Table 1–4 can be fully reproduced without an API key.

1.3 Data dependencies (auto-loaded by the scripts, no manual action needed)

Item Path Role
Historical plans (knowledge base) data/historical/test01~test03.csv 292 signals + TOUT supplement table
MCU documents mcu resource/ TC38x datasheet + user manual
Holdout ground truth data/requirements/test04-...csv GT table, not indexed into the knowledge base

2. Table data generation

All experiment metrics are written to data/outputs/ablation/offline/*.json, and are auto-rendered into tests/thesis_tables/{offline,online}/*.md (see Section 4).

Table 1 — Ablation (tab:offline)

$env:PYTHONUTF8 = "1"
python scripts/run_ablation.py --mode offline --n-cases 5 --seeds 42,43,44,45,46,47 --save-raw
Argument Meaning
--mode offline Deterministic heuristic allocator; no API, fully reproducible. Use online to call the real Bailian LLM
--n-cases 5 5 requirement cases per seed (6 seeds × 5 = 30 runs, paper setup)
--seeds ... Seed list; source of mean±std and paired tests over multiple runs
--save-raw Saves per-run raw metrics raw_metrics.json, and runs Wilcoxon significance tests → significance.json
--rebuild (optional) Rebuild the ChromaDB vector index
--light (optional) Index only 150 key chunks for a quick smoke test
--merge (optional) When re-running a subset of configurations, merge into the existing ablation_results.json instead of overwriting other groups

Output: data/outputs/ablation/offline/ablation_results.json (data source of Table 1).

Table 2 — Embedder comparison (tab:embed) + retrieval metrics

$env:PYTHONUTF8 = "1"
python -m ablation.semantic_generalization --k 10 --out data/outputs/ablation/offline
python scripts/run_ablation.py --mode offline --n-cases 5 --seeds 42 --retrieval-eval --out data/outputs/ablation/offline
Command / Argument Meaning
-m ablation.semantic_generalization Generates semantic_generalization.json: hash vs text-embedding-v3 recall/MRR/nDCG on L1/L2/L3 queries (data source of Table 2). --skip-online skips the v3 embedder (no API call)
--k 10 k for recall@10 / MRR@10 evaluation
--retrieval-eval Runs the retrieval-quality evaluation → retrieval_eval.json (recall@k, MRR@k, nDCG@k)
--out ... Output directory, shared with Table 1 for unified rendering

Table 3 — Baseline comparison (tab:baselines)

$env:PYTHONUTF8 = "1"
python scripts/run_baselines.py --mode offline --n-cases 5 --seeds 42,43,44,45,46,47 --gt 17
python scripts/run_baselines.py --stress --stress-scale 2   # optional: resource-saturation stress scenario
Argument Meaning
--mode offline Same protocol as Table 1; four methods (RuleGreedy / CSP / DictLookup / RAG+LLM(Full)) each run all cases
--n-cases / --seeds Same 30-run protocol as the ablation; averaged per seed
--gt 17 Additionally runs baseline D on 17 GT signals (same GT count as Table 4)
--stress-scale 2 Doubles CAN/SPI/ADC/PWM demand density to test robustness under saturation; also updates baselines.json

Output: data/outputs/ablation/offline/baselines.json (data source of Table 3).

Table 4 — GT attribution (tab:gtattr)

$env:PYTHONUTF8 = "1"
python scripts/run_ablation.py --mode offline --n-cases 5 --seeds 42 --gt-attribution --out data/outputs/ablation/offline
Argument Meaning
--gt-attribution Runs each configuration (Full / -ExactAnchor / DictLookup, etc.) on the 17 GT signals and reports GT hit-rate and hit attribution (exact anchor / semantic / LLM fresh)

Output: data/outputs/ablation/offline/gt_attribution.json (data source of Table 4).


3. Case-study data generation (allocation CSV export)

$env:PYTHONUTF8 = "1"
# If `python` resolves to a bundled interpreter (see Section 1.1) and you get
# ModuleNotFoundError, use the `py` launcher instead:
py scripts/run_allocation.py --req "data/requirements/test04-pin source for Passenger vehicle 1‑motor drive platform TCU.csv" --mode offline
Argument Meaning
--req Requirement CSV. Swap in any real project table as needed
--mode offline Deterministic and reproducible; --mode online calls the Bailian LLM
--rebuild Rebuild the ChromaDB vector index (first run or after data changes)
--mcu Target MCU, default Infineon TC38x
--debug Print query / multi-way recall / rerank / LLM context step by step

Export logic (agent/output/exporter.py):

  • pipeline.run() automatically calls ResultExporter.export() when finished, writing to data/outputs/;
  • Each run produces a file pair: allocation_<tag>_<timestamp>.csv (per-signal: pin / signal / peripheral / rationale / source) plus a same-named .json (conflict list, resource-usage snapshot);
  • Encoded as utf-8-sig, openable directly in Excel;
  • Do not confuse the two output types: allocation result CSVs (above) are the traceable case-study outputs of the paper; experiment metric JSONs (data sources of Tables 1–4) are produced by the ablation/baseline scripts and are not exported as CSVs.

4. Automatic rendering of thesis tables

When run_ablation.py / run_baselines.py finish, they automatically call ablation/thesis_tables.render_thesis_tables(), rendering the JSONs above into tests/thesis_tables/{offline,online}/*.md (one-to-one with tab:offline / tab:embed / tab:baselines / tab:gtattr). No separate rendering step is needed.

Downloads last month
230