Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an error

Aperta Adatta ai principianti
#23,655 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lmoneta ci sta già lavorando.

Dal 9/10/2026.

  • #23668 di @Maher-star-eng — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, python

Direzione di ricerca

Il controllo errato è il confronto con "other" in RModel::GenerateInferSignature in tmva/sofie/src/RModel.cxx (intorno alle righe 1202-1205). ConvertTypeToString in tmva/sofie/src/SOFIE_common.cxx (intorno alla riga 102) restituisce "other_" + type per i tipi sconosciuti, quindi inizia confrontando questi due. Esegui il reproducer Python e verifica che Generate() generi l'errore già esistente di funzionalità non ancora supportata per un input FLOAT16. Un test del parser in TestSofieParser.cxx dovrebbe coprirlo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

AI-Assisted bug in:SOFIE
Check duplicate issues.
  • Checked for duplicates
Description

When a model input has a type that SOFIE does not support, RModel::Generate() is supposed to throw "input tensor ... is of a data type which is not yet supported." (RModel::GenerateInferSignature, tmva/sofie/src/RModel.cxx, lines 1202-1205). That check never fires: it compares the type name with "other", but ConvertTypeToString returns "other_" + std::to_string(type) for the types it does not know (tmva/sofie/src/SOFIE_common.cxx, line 102), e.g. "other_10" for FLOAT16.

So Generate() succeeds and writes a header with other_10 const* tensor_x in the signatures of infer() and doInfer(), and the user only gets an unknown type name 'other_10' compile error later. This affects every type that ConvertTypeToString does not handle (FLOAT16, BFLOAT16, STRING, COMPLEX64/128). Operators such as Relu or Identity reject such inputs themselves, but Shape and Cast let them through.

Expected: Generate() throws the existing "not yet supported" error.

Reproducer
import os
import re

import ROOT
from onnx import TensorProto, helper, save

os.chdir(os.path.dirname(os.path.abspath(__file__)))

node = helper.make_node("Shape", ["x"], ["y"])
graph = helper.make_graph(
    [node],
    "float16_input",
    [helper.make_tensor_value_info("x", TensorProto.FLOAT16, [2, 3])],
    [helper.make_tensor_value_info("y", TensorProto.INT64, [2])],
)
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)], ir_version=8)
save(model, "float16_input.onnx")

ROOT.gInterpreter.Declare("""
#include "TMVA/RModelParser_ONNX.hxx"
std::string float16_generate() {
   using namespace TMVA::Experimental::SOFIE;
   try {
      RModelParser_ONNX parser;
      RModel model = parser.Parse("float16_input.onnx");
      model.Generate();
      model.OutputGenerated("float16_input.hxx");
   } catch (const std::exception &e) {
      return e.what();
   }
   return "no exception";
}
""")
print("Generate():", ROOT.float16_generate())
print("infer signature:", re.search(r"infer\((.*)\)", open("float16_input.hxx").read()).group(1))
print("compiles:", ROOT.gInterpreter.Declare('#include "float16_input.hxx"'))

Output (compiler errors shortened):

./float16_input.hxx:77:28: error: unknown type name 'other_10'
std::vector<int64_t> infer(other_10 const* tensor_x){
Generate(): no exception
infer signature: other_10 const* tensor_x
compiles: False
ROOT version

6.41.01, master at c619e8fbd7f (the code is unchanged in the current master)

Installation method

Built from source (CMake, Release, -Dtesting=ON)

Operating system

macOS 26 (arm64, Apple M4 Pro)

Additional context

I found this while running the ONNX operator tests (from the onnx Python package) through SOFIE. I used AI assistance (Claude) to investigate it I ran the reproducer and checked its output myself. I'll open a PR with a fix and a test in TestSofieParser.cxx.

Lingua principale
C++
Stelle
3.3k
Fork
1.6k
Merge medio
2g 16h
PR unite (30g)
194

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di root-project/root

Tutte le issue di root-project/root

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.