MCPcopy Create free account
hub / github.com/antirez/ds4 / test_tool_call_quality_one

Function test_tool_call_quality_one

tests/ds4_test.c:1966–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1964 state_bytes) != 0);
1965 TEST_ASSERT(ds4_gpu_set_model_map(model_raw, model_bytes) != 0);
1966 ds4_gpu_set_quality(false);
1967
1968 TEST_ASSERT(unsetenv(ape_disable_env) == 0);
1969 TEST_ASSERT(setenv(direct_disable_env, "1", 1) == 0);
1970 TEST_ASSERT(unsetenv(pack_disable_env) == 0);
1971 int ref_ok;
1972 if (replay) {
1973 ref_ok = ds4_gpu_compressor_prefill_ratio4_replay_tensor(
1974 ref_comp, ref_state_kv, ref_state_score, kv, sc,
1975 model_raw, model_bytes, 0, ape_type, norm_offset, 0,
1976 head_dim, pos0, n_tokens, 0, 0, false,
1977 10000.0f, 1.0f, 0.0f, 1.0f, 32.0f, 1.0f, 1.0e-6f);
1978 } else {
1979 ref_ok = ds4_gpu_compressor_prefill_tensor(
1980 ref_comp, ref_state_kv, ref_state_score, kv, sc,
1981 model_raw, model_bytes, 0, ape_type, norm_offset, 0,
1982 head_dim, ratio, pos0, n_tokens, 0, 0, false,
1983 10000.0f, 1.0f, 0.0f, 1.0f, 32.0f, 1.0f, 1.0e-6f);
1984 }
1985 TEST_ASSERT(ref_ok != 0);
1986 TEST_ASSERT(ds4_gpu_tensor_read(
1987 kv, 0, source_after_host, input_bytes) != 0);
1988 TEST_ASSERT(memcmp(kv_host, source_after_host,
1989 (size_t)input_bytes) == 0);
1990 TEST_ASSERT(ds4_gpu_tensor_read(
1991 sc, 0, source_after_host, input_bytes) != 0);
1992 TEST_ASSERT(memcmp(sc_host, source_after_host,
1993 (size_t)input_bytes) == 0);
1994
1995 TEST_ASSERT(unsetenv(direct_disable_env) == 0);
1996 TEST_ASSERT(setenv(pack_disable_env, "1", 1) == 0);
1997 int direct_ok;
1998 if (replay) {
1999 direct_ok = ds4_gpu_compressor_prefill_ratio4_replay_tensor(
2000 direct_comp, direct_state_kv, direct_state_score, kv, sc,
2001 model_raw, model_bytes, 0, ape_type, norm_offset, 0,
2002 head_dim, pos0, n_tokens, 0, 0, false,
2003 10000.0f, 1.0f, 0.0f, 1.0f, 32.0f, 1.0f, 1.0e-6f);
2004 } else {
2005 direct_ok = ds4_gpu_compressor_prefill_tensor(
2006 direct_comp, direct_state_kv, direct_state_score, kv, sc,
2007 model_raw, model_bytes, 0, ape_type, norm_offset, 0,
2008 head_dim, ratio, pos0, n_tokens, 0, 0, false,
2009 10000.0f, 1.0f, 0.0f, 1.0f, 32.0f, 1.0f, 1.0e-6f);
2010 }
2011 TEST_ASSERT(direct_ok != 0);
2012 TEST_ASSERT(ds4_gpu_tensor_read(
2013 kv, 0, source_after_host, input_bytes) != 0);
2014 TEST_ASSERT(memcmp(kv_host, source_after_host,
2015 (size_t)input_bytes) == 0);
2016 TEST_ASSERT(ds4_gpu_tensor_read(
2017 sc, 0, source_after_host, input_bytes) != 0);
2018 TEST_ASSERT(memcmp(sc_host, source_after_host,
2019 (size_t)input_bytes) == 0);
2020
2021 TEST_ASSERT(ds4_gpu_tensor_read(
2022 ref_comp, 0, ref_comp_host, comp_bytes) != 0);

Callers 1

test_tool_call_qualityFunction · 0.85

Calls 15

test_get_engineFunction · 0.85
parse_chat_requestFunction · 0.85
ds4_session_createFunction · 0.85
request_freeFunction · 0.85
ds4_session_syncFunction · 0.85
ds4_session_sampleFunction · 0.85
ds4_token_textFunction · 0.85
observe_tool_markersFunction · 0.85
ds4_session_evalFunction · 0.85
tool_calls_freeFunction · 0.85

Tested by

no test coverage detected